1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-22 07:51:17 -08:00

Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

This commit is contained in:
Eli Zaretskii 2021-02-04 18:02:27 +02:00
commit a304b22bc9

View file

@ -1373,7 +1373,24 @@ and initial semicolons."
(derived-mode-p 'emacs-lisp-mode))
emacs-lisp-docstring-fill-column
fill-column)))
(fill-paragraph justify))
(save-restriction
(save-excursion
(let ((ppss (syntax-ppss)))
;; If we're in a string, then narrow (roughly) to that
;; string before filling. This avoids filling Lisp
;; statements that follow the string.
(when (ppss-string-terminator ppss)
(goto-char (ppss-comment-or-string-start ppss))
(beginning-of-line)
;; The string may be unterminated -- in that case, don't
;; narrow.
(when (ignore-errors
(progn
(forward-sexp 1)
t))
(narrow-to-region (ppss-comment-or-string-start ppss)
(point))))
(fill-paragraph justify)))))
;; Never return nil.
t))