diff options
| author | Richard M. Stallman | 1997-11-24 03:32:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-11-24 03:32:20 +0000 |
| commit | 7eb67d79ac67a1d6abaec4b797d9587612972751 (patch) | |
| tree | 17f3d49f23844eb6d96c6e9264184cb740af752a | |
| parent | 1061ff16f49198bf02f943810e3241e99bc1bb92 (diff) | |
| download | emacs-7eb67d79ac67a1d6abaec4b797d9587612972751.tar.gz emacs-7eb67d79ac67a1d6abaec4b797d9587612972751.zip | |
(lisp-mode-auto-fill): New function.
(lisp-mode-variables): Bind normal-auto-fill-function.
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 13 |
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 @@ | |||
| 109 | ;; because lisp-fill-paragraph should do the job. | 109 | ;; because lisp-fill-paragraph should do the job. |
| 110 | (make-local-variable 'adaptive-fill-mode) | 110 | (make-local-variable 'adaptive-fill-mode) |
| 111 | (setq adaptive-fill-mode nil) | 111 | (setq adaptive-fill-mode nil) |
| 112 | (make-local-variable 'normal-auto-fill-function) | ||
| 113 | (setq normal-auto-fill-function 'lisp-mode-auto-fill) | ||
| 112 | (make-local-variable 'indent-line-function) | 114 | (make-local-variable 'indent-line-function) |
| 113 | (setq indent-line-function 'lisp-indent-line) | 115 | (setq indent-line-function 'lisp-indent-line) |
| 114 | (make-local-variable 'indent-region-function) | 116 | (make-local-variable 'indent-region-function) |
| @@ -362,6 +364,17 @@ With argument, insert value in current buffer after the defun." | |||
| 362 | (max (if (bolp) 0 (1+ (current-column))) | 364 | (max (if (bolp) 0 (1+ (current-column))) |
| 363 | comment-column)))) | 365 | comment-column)))) |
| 364 | 366 | ||
| 367 | (defun lisp-mode-auto-fill () | ||
| 368 | (if (> (current-column) (current-fill-column)) | ||
| 369 | (if (save-excursion | ||
| 370 | (nth 4 (parse-partial-sexp (save-excursion | ||
| 371 | (beginning-of-defun) | ||
| 372 | (point)) | ||
| 373 | (point)))) | ||
| 374 | (do-auto-fill) | ||
| 375 | (let ((comment-start nil) (comment-start-skip nil)) | ||
| 376 | (do-auto-fill))))) | ||
| 377 | |||
| 365 | (defvar lisp-indent-offset nil "") | 378 | (defvar lisp-indent-offset nil "") |
| 366 | (defvar lisp-indent-function 'lisp-indent-function "") | 379 | (defvar lisp-indent-function 'lisp-indent-function "") |
| 367 | 380 | ||