Commit 8f5d9d0a authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen
Browse files

Fix a recent Lisp mode filling test failure

* lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Restore the
"fill first line separately" logic.
parent 6a96d177
Pipeline #18800 failed with stages
in 31 minutes and 18 seconds
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment