# HG changeset patch # User Dave Love # Date 890236957 0 # Node ID 2816d2c192fbdbe114f6a351a64e0b2aab2e6583 # Parent 73a8874d25cefcb75e4df6965f63b6a458f14539 (lisp-fill-paragraph): Adjust paragraph-start in default filling case so that filling doc strings works. diff -r 73a8874d25ce -r 2816d2c192fb lisp/emacs-lisp/lisp-mode.el --- a/lisp/emacs-lisp/lisp-mode.el Wed Mar 18 13:25:00 1998 +0000 +++ b/lisp/emacs-lisp/lisp-mode.el Wed Mar 18 16:02:37 1998 +0000 @@ -802,7 +802,17 @@ (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