Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mode.el @ 20333:3627bd4b83d9
(lisp-mode-auto-fill): New function.
(lisp-mode-variables): Bind normal-auto-fill-function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 24 Nov 1997 03:32:20 +0000 |
parents | cc417f06a333 |
children | 90f306f86f5d |
comparison
equal
deleted
inserted
replaced
20332:52b1ed13e4d2 | 20333:3627bd4b83d9 |
---|---|
107 ;; Adaptive fill mode gets in the way of auto-fill, | 107 ;; Adaptive fill mode gets in the way of auto-fill, |
108 ;; and should make no difference for explicit fill | 108 ;; and should make no difference for explicit fill |
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) |
115 (setq indent-region-function 'lisp-indent-region) | 117 (setq indent-region-function 'lisp-indent-region) |
116 (make-local-variable 'parse-sexp-ignore-comments) | 118 (make-local-variable 'parse-sexp-ignore-comments) |
359 (let ((tem (or (calculate-lisp-indent) (current-column)))) | 361 (let ((tem (or (calculate-lisp-indent) (current-column)))) |
360 (if (listp tem) (car tem) tem)) | 362 (if (listp tem) (car tem) tem)) |
361 (skip-chars-backward " \t") | 363 (skip-chars-backward " \t") |
362 (max (if (bolp) 0 (1+ (current-column))) | 364 (max (if (bolp) 0 (1+ (current-column))) |
363 comment-column)))) | 365 comment-column)))) |
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))))) | |
364 | 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 |
368 (defun lisp-indent-line (&optional whole-exp) | 381 (defun lisp-indent-line (&optional whole-exp) |