# HG changeset patch # User Richard M. Stallman # Date 880342340 0 # Node ID 3627bd4b83d98bb7ed64359b0adaad2050e250b1 # Parent 52b1ed13e4d203e223a3154ffaf58c3f65a530cb (lisp-mode-auto-fill): New function. (lisp-mode-variables): Bind normal-auto-fill-function. diff -r 52b1ed13e4d2 -r 3627bd4b83d9 lisp/emacs-lisp/lisp-mode.el --- a/lisp/emacs-lisp/lisp-mode.el Sun Nov 23 02:30:00 1997 +0000 +++ b/lisp/emacs-lisp/lisp-mode.el Mon Nov 24 03:32:20 1997 +0000 @@ -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 @@ (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 "")