Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing unfill for org buffers #11

Closed
wants to merge 1 commit into from

Conversation

psionic-k
Copy link

Hello Steve. I needed to quickly unfill org buffers for switching to visual line mode and this seems like an appropriate command for this package.

Still not totally clear on the necessity of expressing built-in requirements. I get asked sometimes to add package-requires values. Should be okay with org.

Can't recall which function needed Emacs 24.3 but not really worried about versions that old.

See commit notes for extra explanation.

Using `org-unindent-buffer` as a starting point, instead of removing
indentation, we just:
- unfill paragraphs
- unfill list items in reverse
Copy link
Owner

@purcell purcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, thanks! A test or two would be useful, and perhaps even a doc update. This does feel like a slightly odd addition to this package, though: the new function operates on the whole buffer, unlike the existing functions, and I suspect it would sit better in org itself, as the alternative of adding unfill-x functions for various x is clunky. I'd also have to understand and maintain all those functions. So I'm a little on the fence w.r.t. merging this tbh, though obviously I can understand the usefulness. :)

Includes paragraphs embedded in item lists."
(interactive)
;; The following body heavily borrows from `org-unindent-buffer'.
(unless (and (eq major-mode 'org-mode))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use derived-mode-p here.

(interactive)
;; The following body heavily borrows from `org-unindent-buffer'.
(unless (and (eq major-mode 'org-mode))
(user-error "Cannot unfill a buffer not in Org mode"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely the function that required emacs-24.3

@psionic-k
Copy link
Author

would sit better in org itself

I'll put in your good word, but cries in mailing list 🐱 Hopefully things will go smoothly.

@psionic-k
Copy link
Author

My understanding is that I found a bug in unfill-region that we will handle on the emacs-devel mailing list. I will publish the interim fix separately. Closing.

@psionic-k psionic-k closed this Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants