summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-07-04 20:13:45 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-07-04 20:13:45 +0000
commitc13ce396aeedefa97d7f819e20256428ec82140c (patch)
treee6479d95a44d3c98e8d50da2c8398fce3aa07344 /lisp/emacs-lisp
parent0ea7c863fb10efb2bf73a46c1c0e8bf22e620b69 (diff)
downloademacs-c13ce396aeedefa97d7f819e20256428ec82140c.tar.gz
emacs-c13ce396aeedefa97d7f819e20256428ec82140c.tar.bz2
emacs-c13ce396aeedefa97d7f819e20256428ec82140c.zip
(lisp-mode-variables): Prevent adaptive
filling from using prefix when filling a single-line docstring.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 75dfe313de8..8469aec1362 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -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.