comparison lisp/emacs-lisp/lisp-mode.el @ 21213:2816d2c192fb

(lisp-fill-paragraph): Adjust paragraph-start in default filling case so that filling doc strings works.
author Dave Love <fx@gnu.org>
date Wed, 18 Mar 1998 16:02:37 +0000
parents ccf251830c66
children 366a1d025c6c
comparison
equal deleted inserted replaced
21212:73a8874d25ce 21213:2816d2c192fb
800 (concat (make-string (/ (current-column) 8) ?\t) 800 (concat (make-string (/ (current-column) 8) ?\t)
801 (make-string (% (current-column) 8) ?\ ) 801 (make-string (% (current-column) 8) ?\ )
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
809 (save-restriction 819 (save-restriction
810 (beginning-of-line) 820 (beginning-of-line)