]> git.eshelyaron.com Git - emacs.git/commitdiff
Actually fill the correct paragraph in `lisp-fill-paragraph'
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 5 Mar 2021 13:01:00 +0000 (14:01 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 5 Mar 2021 13:01:00 +0000 (14:01 +0100)
* lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Fix previous
change here by actually filling the correct paragraph (bug#28937).

lisp/emacs-lisp/lisp-mode.el

index 257ac7412e847957e9a7d99a2c1997d0faf335bc..4aa8ddcfa11f0f1f4bf80500c99620cb38baeb2e 100644 (file)
@@ -1371,7 +1371,8 @@ and initial semicolons."
                            fill-column)))
         (save-restriction
           (save-excursion
-          (let ((ppss (syntax-ppss)))
+          (let ((ppss (syntax-ppss))
+                (start (point)))
             ;; If we're in a string, then narrow (roughly) to that
             ;; string before filling.  This avoids filling Lisp
             ;; statements that follow the string.
@@ -1386,6 +1387,8 @@ and initial semicolons."
                         t))
                 (narrow-to-region (ppss-comment-or-string-start ppss)
                                   (point))))
+            ;; Move back to where we were.
+            (goto-char start)
            (fill-paragraph justify)))))
       ;; Never return nil.
       t))