diff options
author | Dave Love <fx@gnu.org> | 1998-03-18 16:02:37 +0000 |
---|---|---|
committer | Dave Love <fx@gnu.org> | 1998-03-18 16:02:37 +0000 |
commit | fe3188ecbd12e887dc41940328bbbac51652c6ca (patch) | |
tree | 3e5e04908c9c315e2906bdcdcd0f66819e20d57b /lisp/emacs-lisp/lisp-mode.el | |
parent | 01e02ab3875e43f10a0cf286455831b62b6c325e (diff) | |
download | emacs-fe3188ecbd12e887dc41940328bbbac51652c6ca.tar.gz emacs-fe3188ecbd12e887dc41940328bbbac51652c6ca.tar.bz2 emacs-fe3188ecbd12e887dc41940328bbbac51652c6ca.zip |
(lisp-fill-paragraph): Adjust
paragraph-start in default filling case so that filling doc
strings works.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-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." (buffer-substring (match-beginning 0) (match-end 0))))))) (if (not has-comment) - (fill-paragraph justify) + ;; `paragraph-start' is set here (not in the buffer-local + ;; variable so that `forward-paragraph' et al work as + ;; expected) so that filling (doc) strings works sensibly. + ;; Adding the opening paren to avoid the following sexp being + ;; filled means that sexps generally aren't filled as normal + ;; text, which is probably sensible. The `;' and `:' stop the + ;; filled para at following comment lines and keywords + ;; (typically in `defcustom'). + (let ((paragraph-start (concat paragraph-start + "\\|\\s-*[\(;:\"]"))) + (fill-paragraph justify)) ;; Narrow to include only the comment, and then fill the region. (save-excursion |