GNU bug report logs - #56197
lisp-fill-paragraph behavior changed in Emacs 28

Previous Next

Package: emacs;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Fri, 24 Jun 2022 16:18:01 UTC

Severity: normal

Tags: patch

Found in version 28.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 56197 <at> debbugs.gnu.org, felix.lechner <at> lease-up.com, stefankangas <at> gmail.com
Subject: bug#56197: [PATCH v2] lisp: Introduce a `lisp-fill-paragraph-as-displayed' variable.
Date: Tue, 21 Jan 2025 11:43:27 +0900
Hi,

Eli Zaretskii <eliz <at> gnu.org> writes:

[...]

>> * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph-as-displayed): New
>> variable.
>> (lisp-fill-paragraph): Honor it, by avoiding the logic narrow to strings
>> before applying fill-paragraph.
>> * test/lisp/emacs-lisp/lisp-mode-tests.el
>> (lisp-fill-paragraph-respects-fill-column): Test it.
>> (lisp-fill-paragraph-docstring-boundaries): New test, as a safeguard to
>> avoid regressions.
>
> Please format these entries according to our conventions, mostly
> regarding the line length (it should be at most 69 columns, preferably
> no more than 64.

Done.  It's odd that when using magit there's no easy way to have this
this set by default (it defaults to use the text-mode major mode).  I've
M-x log-edit-mode in the edit buffer to get the .dir-locals.el
preferences applied.

>> -;; Copyright (C) 1985-1986, 1999-2024 Free Software Foundation, Inc.
>> +;; Copyright (C) 1985-1986, 1999-2025 Free Software Foundation, Inc.
>
> Please rebase on the current master branch, where the copyright years
> were already updated.

Done.

>> +(defvar lisp-fill-paragraph-as-displayed nil
>> +  "This variable can be set to true to fill paragraphs as displayed in the
>> +buffer, preserving surrounding context such as the leading indentation.
>> +This is useful if respecting `fill-column' is more important than
>> +preventing surrounding code from being filled, and makes
>> +`lisp-fill-paragraph' behave as it used to in Emacs 27 and prior
>> +versions.")
>
> The first line of a doc string should be a single full sentence.
> (This is because the various apropos commands show only the first
> line.)
>
> More importantly, I think this doc string should describe the main use
> case for which the default behavior is tuned: filling Emacs Lisp doc
> strings, with their special treatment of the first line.

I expound the docstring to add more information w.r.t. to the default
behavior of `lisp-fill-paragraph'.  I hope it addresses your comment.

I'll send v3 shortly.

-- 
Thanks,
Maxim




This bug report was last modified 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.