summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-11-24 03:32:20 +0000
committerRichard M. Stallman <rms@gnu.org>1997-11-24 03:32:20 +0000
commit7eb67d79ac67a1d6abaec4b797d9587612972751 (patch)
tree17f3d49f23844eb6d96c6e9264184cb740af752a /lisp
parent1061ff16f49198bf02f943810e3241e99bc1bb92 (diff)
downloademacs-7eb67d79ac67a1d6abaec4b797d9587612972751.tar.gz
(lisp-mode-auto-fill): New function.
(lisp-mode-variables): Bind normal-auto-fill-function.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index fa253e09771..f6a09eaba2c 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -109,6 +109,8 @@
;; because lisp-fill-paragraph should do the job.
(make-local-variable 'adaptive-fill-mode)
(setq adaptive-fill-mode nil)
+ (make-local-variable 'normal-auto-fill-function)
+ (setq normal-auto-fill-function 'lisp-mode-auto-fill)
(make-local-variable 'indent-line-function)
(setq indent-line-function 'lisp-indent-line)
(make-local-variable 'indent-region-function)
@@ -362,6 +364,17 @@ With argument, insert value in current buffer after the defun."
(max (if (bolp) 0 (1+ (current-column)))
comment-column))))
+(defun lisp-mode-auto-fill ()
+ (if (> (current-column) (current-fill-column))
+ (if (save-excursion
+ (nth 4 (parse-partial-sexp (save-excursion
+ (beginning-of-defun)
+ (point))
+ (point))))
+ (do-auto-fill)
+ (let ((comment-start nil) (comment-start-skip nil))
+ (do-auto-fill)))))
+
(defvar lisp-indent-offset nil "")
(defvar lisp-indent-function 'lisp-indent-function "")