diff options
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d248479cdb3..109a891b579 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -802,7 +802,17 @@ and initial semicolons." | |||
| 802 | (buffer-substring (match-beginning 0) (match-end 0))))))) | 802 | (buffer-substring (match-beginning 0) (match-end 0))))))) |
| 803 | 803 | ||
| 804 | (if (not has-comment) | 804 | (if (not has-comment) |
| 805 | (fill-paragraph justify) | 805 | ;; `paragraph-start' is set here (not in the buffer-local |
| 806 | ;; variable so that `forward-paragraph' et al work as | ||
| 807 | ;; expected) so that filling (doc) strings works sensibly. | ||
| 808 | ;; Adding the opening paren to avoid the following sexp being | ||
| 809 | ;; filled means that sexps generally aren't filled as normal | ||
| 810 | ;; text, which is probably sensible. The `;' and `:' stop the | ||
| 811 | ;; filled para at following comment lines and keywords | ||
| 812 | ;; (typically in `defcustom'). | ||
| 813 | (let ((paragraph-start (concat paragraph-start | ||
| 814 | "\\|\\s-*[\(;:\"]"))) | ||
| 815 | (fill-paragraph justify)) | ||
| 806 | 816 | ||
| 807 | ;; Narrow to include only the comment, and then fill the region. | 817 | ;; Narrow to include only the comment, and then fill the region. |
| 808 | (save-excursion | 818 | (save-excursion |