Closed DamienCassou closed 3 years ago
When you run fill-paragraph
in an emacs-lisp
buffer, it fills to emacs-lisp-docstring-fill-column
, which in your case is probably 65. (I believe it does this whether you're filling a docstring or code -- but not comments.)
It would be nice if poporg set fill-column
to emacs-lisp-docstring-fill-column
if you're editing an emacs-lisp
buffer. This can be accomplished by adding a hook to poporg-edit-hook
. Here's how you can tell what mode your original buffer is in:
(defun my:editing-lisp-string-p ()
"Return true if this is a poporg edit buffer from a lisp buffer."
(let ((buf (poporg-orig-buffer)))
(and buf (with-current-buffer buf
(derived-mode-p 'emacs-lisp-mode)) t)))
Joe Rabinoff notifications@github.com writes:
[…] It would be nice if poporg set
fill-column
toemacs-lisp-docstring-fill-column
if you're editing anemacs-lisp
buffer. This can be accomplished by adding a hook topoporg-edit-hook
.
thank you for your answer. Are you suggesting that (1) poporg itself should do something similar or that (2) it is the responsibility of users to change their configuration? I think (1) makes more sense.
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
To me, this is a quirk of emacs-lisp-mode
. If you do fill-region
on a docstring in an emacs-lisp
buffer, then it uses fill-column
anyway, so the behavior isn't consistent even within the major mode. Which behavior should poporg replicate? I'd argue that the correct answer is to just set emacs-lisp-docstring-fill-column
to fill-column
.
That said, I could go either way on this -- you're always welcome to submit a pull request.
If I go to line 113 of this file and type
M-x lisp-fill-paragraph
, nothing changes. But if I open poporg's buffer and typeM-x org-fill-paragraph
, then the wordback
(first word of line 114) comes at the end of line 113. Thefill-column
in both buffers is 70.