]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename a recently-added variable (bug#56197)
authorEli Zaretskii <eliz@gnu.org>
Sat, 1 Feb 2025 10:22:13 +0000 (12:22 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 3 Feb 2025 11:12:16 +0000 (12:12 +0100)
* lisp/emacs-lisp/lisp-mode.el
(lisp-fill-paragraphs-as-doc-string): Renamed from
'lisp-fill-paragraph-as-displayed' and default value reversed.
(lisp-fill-paragraph): Adjust to the change.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-fill-paragraph-as-displayed): Likewise.

(cherry picked from commit e067f2763fd52b78342b5c759205032227e82ebe)

lisp/emacs-lisp/lisp-mode.el
test/lisp/emacs-lisp/lisp-mode-tests.el

index 46bd350335cf4ece1bb2912d380d80ac46a671a0..e2b5da52f95292d7003286e4c7f72be4d2653c9c 100644 (file)
@@ -1424,16 +1424,17 @@ Any non-integer value means do not use a different value of
   :group 'lisp
   :version "30.1")
 
-(defvar lisp-fill-paragraph-as-displayed nil
-  "Modify the behavior of `lisp-fill-paragraph'.
+(defvar lisp-fill-paragraphs-as-doc-string t
+  "Whether `lisp-fill-paragraph' should fill strings as ELisp doc strings.
 The default behavior of `lisp-fill-paragraph' is tuned for filling Emacs
 Lisp doc strings, with their special treatment for the first line.
-Particularly, strings are filled in a narrowed context to avoid filling
+Specifically, strings are filled in a narrowed context to avoid filling
 surrounding code, which means any leading indent is disregarded, which
 can cause the filled string to extend passed the configured
 `fill-column' variable value.  If you would rather fill the string in
-its original context and ensure the `fill-column' value is more strictly
-respected, set this variable to true.  Doing so makes
+its original context, disregarding the special conventions of ELisp doc
+strings, and want to ensure the `fill-column' value is more strictly
+respected, set this variable to nil.  Doing so makes
 `lisp-fill-paragraph' behave as it used to in Emacs 27 and prior
 versions.")
 
@@ -1499,7 +1500,7 @@ and initial semicolons."
               ;; code.
               (if (not string-start)
                   (lisp--fill-line-simple)
-                (unless lisp-fill-paragraph-as-displayed
+                (when lisp-fill-paragraphs-as-doc-string
                   ;; If we're in a string, then narrow (roughly) to that
                   ;; string before filling.  This avoids filling Lisp
                   ;; statements that follow the string.
index 2a9a7aa46d2346806ef82accb1bca830ebc958e5..f6d191ec4c57985b9584e68eba5d322b876d922b 100644 (file)
@@ -333,7 +333,7 @@ Here is some more text.\"
 (ert-deftest lisp-fill-paragraph-as-displayed ()
   "Test bug#56197 -- more specifically, validate that a leading indentation
 for a string is preserved in the filled string."
-  (let ((lisp-fill-paragraph-as-displayed t) ;variable under test
+  (let ((lisp-fill-paragraphs-as-doc-string nil) ;variable under test
         ;; The following is a contrived example that demonstrates the
         ;; fill-column problem when the string to fill is indented.
         (source "\