diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-06-26 16:31:33 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-06-26 16:31:43 +0200 |
commit | 8f5d9d0abd0f5078646bc85c7a4d480b32057a47 (patch) | |
tree | 1278c67cca00aaf5b5b4b53b1d73421682f5f054 /lisp/emacs-lisp/lisp-mode.el | |
parent | 6a96d1773469e671a3d5710bedf68c21929b5183 (diff) | |
download | emacs-8f5d9d0abd0f5078646bc85c7a4d480b32057a47.tar.gz |
Fix a recent Lisp mode filling test failure
* lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Restore the
"fill first line separately" logic.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 781c80fd5a0..6d5391d1e90 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1426,6 +1426,9 @@ and initial semicolons." ;; a comment: Point is on a program line; we are interested ;; particularly in docstring lines. ;; + ;; FIXME: The below bindings are probably mostly irrelevant + ;; since we're now narrowing to a region before filling. + ;; ;; We bind `paragraph-start' and `paragraph-separate' temporarily. They ;; are buffer-local, but we avoid changing them so that they can be set ;; to make `forward-paragraph' and friends do something the user wants. @@ -1485,6 +1488,15 @@ and initial semicolons." (1- (point))))) ;; Move back to where we were. (goto-char start) + ;; We should fill the first line of a string + ;; separately (since it's usually a doc string). + (if (= (line-number-at-pos) 1) + (narrow-to-region (line-beginning-position) + (line-beginning-position 2)) + (save-excursion + (goto-char (point-min)) + (forward-line 1) + (narrow-to-region (point) (point-max)))) (fill-paragraph justify))))))) ;; Never return nil. t) |