changeset 64088:6b665a797211

(lisp-mode-variables): Prevent adaptive filling from using prefix when filling a single-line docstring.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 04 Jul 2005 20:13:34 +0000
parents 16a14151b339
children 149c7b15b68e
files lisp/emacs-lisp/lisp-mode.el
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el	Mon Jul 04 18:54:30 2005 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Mon Jul 04 20:13:34 2005 +0000
@@ -172,6 +172,10 @@
   (setq paragraph-ignore-fill-prefix t)
   (make-local-variable 'fill-paragraph-function)
   (setq fill-paragraph-function 'lisp-fill-paragraph)
+  ;; Adaptive fill mode gets the fill wrong for a one-line paragraph made of
+  ;; a single docstring.  Let's fix it here.
+  (set (make-local-variable 'adaptive-fill-function)
+       (lambda () (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") "")))
   ;; Adaptive fill mode gets in the way of auto-fill,
   ;; and should make no difference for explicit fill
   ;; because lisp-fill-paragraph should do the job.