aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/lisp-mode.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 3334471d251..1e38d44e1b1 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -576,6 +576,13 @@ Lisp font lock syntactic face function."
576 font-lock-string-face)))) 576 font-lock-string-face))))
577 font-lock-comment-face)) 577 font-lock-comment-face))
578 578
579(defun lisp-adaptive-fill ()
580 "Return fill prefix found at point.
581Value for `adaptive-fill-function'."
582 ;; Adaptive fill mode gets the fill wrong for a one-line paragraph made of
583 ;; a single docstring. Let's fix it here.
584 (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") ""))
585
579(defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive 586(defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive
580 elisp) 587 elisp)
581 "Common initialization routine for lisp modes. 588 "Common initialization routine for lisp modes.
@@ -587,10 +594,7 @@ font-lock keywords will not be case sensitive."
587 (set-syntax-table lisp-mode-syntax-table)) 594 (set-syntax-table lisp-mode-syntax-table))
588 (setq-local paragraph-ignore-fill-prefix t) 595 (setq-local paragraph-ignore-fill-prefix t)
589 (setq-local fill-paragraph-function 'lisp-fill-paragraph) 596 (setq-local fill-paragraph-function 'lisp-fill-paragraph)
590 ;; Adaptive fill mode gets the fill wrong for a one-line paragraph made of 597 (setq-local adaptive-fill-function #'lisp-adaptive-fill)
591 ;; a single docstring. Let's fix it here.
592 (setq-local adaptive-fill-function
593 (lambda () (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") "")))
594 ;; Adaptive fill mode gets in the way of auto-fill, 598 ;; Adaptive fill mode gets in the way of auto-fill,
595 ;; and should make no difference for explicit fill 599 ;; and should make no difference for explicit fill
596 ;; because lisp-fill-paragraph should do the job. 600 ;; because lisp-fill-paragraph should do the job.