From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, 56197@debbugs.gnu.org,
Felix Lechner <felix.lechner@lease-up.com>,
stefankangas@gmail.com
Subject: bug#56197: 28.1; lisp-fill-paragraph result regressed with Emacs 28
Date: Sat, 28 Dec 2024 14:26:32 +0900 [thread overview]
Message-ID: <87seq8tm2f.fsf@gmail.com> (raw)
In-Reply-To: <86v7v7ynf0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Dec 2024 08:21:39 +0200")
Hello,
Eli Zaretskii <eliz@gnu.org> writes:
[...]
>> Filling strings in code would be useful, but isn't that a separate,
>> don't-break-my-strings feature?
>
> Not necessarily. I frequently fill stuff in my code, and don't want
> to use a separate command if the region I fill includes strings (or
> comments, or something other that needs special filling behavior).
I agree that having a single way to 'fill text/code/whatever' is nice.
[...]
> You are quoting text which talks about the _default_ filling. The
> default filling is tailored to "uniform" text, i.e. really to Text
> mode and its descendants.
>
> However, Emacs lets major modes customize filling as appropriate for
> the mode, by defining mode-specific filling functions. Which is what
> happens in this case: lisp-mode.el defines a fill-paragraph function
> that is specific to Lisp modes. It is completely legitimate for such
> mode-specific functions to special-case strings inside code and do
> something special about that.
>
> So I don't see how what we do now is against the spirit of filling.
Maybe it doesn't in general, but in the case of Guix packages, it's
strikingly odd compared to the past behavior which was respecting the
fill-column in a long multi-line string (refer to the original issue I
had detailed in this thread for an example).
> (Btw, I think it's high time we closed that bug, since Emacs 28.2 was
> released long ago.)
It's a change of behavior introduced in version 28 that apparently
doesn't make unanimity (though perhaps noticed mostly by Guix
developers, where the use of the multi-line strings for package
descriptions makes this issue very visible and annoying); the GNU Guix
project has been carrying this in its .dir-locals.el file, which simply
reverts to the old behavior before commit 9bf367e1848:
--8<---------------cut here---------------start------------->8---
;; Emacs 28 changed the behavior of 'lisp-fill-paragraph', which causes the
;; first line of package descriptions to extrude past 'fill-column', and
;; somehow that is deemed more correct upstream (see:
;; https://issues.guix.gnu.org/56197).
(eval . (progn
(require 'lisp-mode)
(defun emacs27-lisp-fill-paragraph (&optional justify)
(interactive "P")
(or (fill-comment-paragraph justify)
(let ((paragraph-start
(concat paragraph-start
"\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
(paragraph-separate
(concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
(fill-column (if (and (integerp emacs-lisp-docstring-fill-column)
(derived-mode-p 'emacs-lisp-mode))
emacs-lisp-docstring-fill-column
fill-column)))
(fill-paragraph justify))
;; Never return nil.
t))
(setq-local fill-paragraph-function #'emacs27-lisp-fill-paragraph)))
--8<---------------cut here---------------end--------------->8---
I can't say it feels very satisfactory; a switch like one imagined by
Felix could be a step in the right direction; it'd be at least more
concise in the project .dir-locals. Would a patch implementing that be
welcome?
Happy New Year,
--
Maxim
next prev parent reply other threads:[~2024-12-28 5:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 16:17 bug#56197: 28.1; lisp-fill-paragraph result regressed with Emacs 28 Maxim Cournoyer
2022-06-25 11:53 ` Lars Ingebrigtsen
2022-06-25 12:42 ` Eli Zaretskii
2022-06-25 12:45 ` Lars Ingebrigtsen
2022-06-25 12:48 ` Lars Ingebrigtsen
2022-06-25 13:00 ` Lars Ingebrigtsen
2022-06-29 18:03 ` Stefan Kangas
2022-06-30 9:32 ` Lars Ingebrigtsen
2022-06-30 9:33 ` Lars Ingebrigtsen
2024-12-26 15:16 ` Stefan Kangas
2024-12-28 5:52 ` Maxim Cournoyer
2024-12-28 8:47 ` Eli Zaretskii
2024-12-28 14:51 ` Maxim Cournoyer
2024-12-28 8:52 ` Stefan Kangas
2022-06-30 11:31 ` Maxim Cournoyer
2022-07-01 9:05 ` Lars Ingebrigtsen
2024-12-25 20:15 ` Felix Lechner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-26 6:21 ` Eli Zaretskii
2024-12-28 5:26 ` Maxim Cournoyer [this message]
2024-12-28 8:45 ` Eli Zaretskii
2024-12-28 15:14 ` Maxim Cournoyer
2022-06-27 1:53 ` Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87seq8tm2f.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=56197@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=felix.lechner@lease-up.com \
--cc=larsi@gnus.org \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.