unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode
@ 2018-05-30 12:50 Stefan Guath
  2018-06-01  9:20 ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Guath @ 2018-05-30 12:50 UTC (permalink / raw)
  To: 31656

[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]

VERSION
GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17
Version 10.10.5 (Build 14F2511)) of 2018-05-28

DESCRIPTION
`emacs-lisp-docstring-fill-column' shadows `fill-column' in too many cases
in emacs-lisp-mode. The documentation of `emacs-lisp-docstring-fill-column'
states: "Value of ‘fill-column’ to use when filling a docstring". But it
incorrectly seems to be used in a lot more cases than just in a docstring
(the only case that I've found where ‘fill-column’ is actually respected is
within comments). A work-around is to set
`emacs-lisp-docstring-fill-column' to nil, but it would be nice to have it
working properly instead.

I might be missing something, but think the incorrect behavior is to be
found in `lisp-fill-paragraph' that is invoked by `fill-paragraph' through
`fill-paragraph-function'. It seems like `lisp-fill-paragraph'
unconditionally sets `fill-column' to `emacs-lisp-docstring-fill-column'
without checking whether point is within a doc string first. The only
requirements for enable shadowing currently seems to be "(and (integerp
emacs-lisp-docstring-fill-column) (derived-mode-p 'emacs-lisp-mode))",
which doesn't seems sufficient.

TO REPRODUCE
* emacs -q
* C-x b <return> (i.e. switch to *scratch* buffer)
* M-x emacs-lisp-mode
* M-x column-number-mode (optional)
* (setq fill-column 80) ;used by `fill-paragraph'
* (setq emacs-lisp-docstring-fill-column 40) ;should override `fill-column'
in doc strings only!
* Paste in the line "word00 word01 word02 word03 word04 word05 word06
word07 word08 word09 word10 word11" (i.e. 12 words, 83 chars)
* M-x fill-paragraph (with point on pasted line above)
* The value of `emacs-lisp-docstring-fill-column' (40) is incorrectly used
when formatting. The value of `fill-column' (80) should have been used
instead, since the point is not in a doc string.

Note that the default value of `emacs-lisp-docstring-fill-column' is 65
(rather than nil), so this malformatting is enabled by default.

[-- Attachment #2: Type: text/html, Size: 2391 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-04-13  3:06 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-30 12:50 bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode Stefan Guath
2018-06-01  9:20 ` Eli Zaretskii
2018-06-01  9:39   ` Noam Postavsky
2018-06-01 10:36     ` Stefan Guath
2018-06-01 12:52       ` Eli Zaretskii
2018-06-01 14:34         ` Stefan Guath
2018-06-01 15:10           ` Eli Zaretskii
2018-06-01 12:43     ` Eli Zaretskii
2018-06-02  1:45       ` Noam Postavsky
2018-06-02  6:41         ` Eli Zaretskii
2018-06-02 13:07           ` Noam Postavsky
2018-06-02 13:25             ` martin rudalics
2018-06-02 13:34               ` Noam Postavsky
2018-06-02 14:09             ` Eli Zaretskii
2018-06-03 12:51               ` Stefan Guath
2020-08-22 15:23             ` Lars Ingebrigtsen
2022-04-13  3:06               ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).