comparison lisp/emacs-lisp/lisp-mode.el @ 94187:72eb648a4690

* emacs-lisp/lisp-mode.el (lisp-mode-auto-fill): Make it an alias. * progmodes/scheme.el (scheme-mode-variables): Don't use it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 19 Apr 2008 19:35:09 +0000
parents 3f795454be96
children 2f4d6806f156
comparison
equal deleted inserted replaced
94186:7870d07a291c 94187:72eb648a4690
214 ;; because lisp-fill-paragraph should do the job. 214 ;; because lisp-fill-paragraph should do the job.
215 ;; I believe that newcomment's auto-fill code properly deals with it -stef 215 ;; I believe that newcomment's auto-fill code properly deals with it -stef
216 ;;(set (make-local-variable 'adaptive-fill-mode) nil) 216 ;;(set (make-local-variable 'adaptive-fill-mode) nil)
217 (make-local-variable 'indent-line-function) 217 (make-local-variable 'indent-line-function)
218 (setq indent-line-function 'lisp-indent-line) 218 (setq indent-line-function 'lisp-indent-line)
219 (make-local-variable 'indent-region-function)
220 (setq indent-region-function 'lisp-indent-region)
221 (make-local-variable 'parse-sexp-ignore-comments) 219 (make-local-variable 'parse-sexp-ignore-comments)
222 (setq parse-sexp-ignore-comments t) 220 (setq parse-sexp-ignore-comments t)
223 (make-local-variable 'outline-regexp) 221 (make-local-variable 'outline-regexp)
224 (setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(") 222 (setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
225 (make-local-variable 'outline-level) 223 (make-local-variable 'outline-level)
781 if it already has a value.\) 779 if it already has a value.\)
782 780
783 With argument, insert value in current buffer after the defun. 781 With argument, insert value in current buffer after the defun.
784 Return the result of evaluation." 782 Return the result of evaluation."
785 (interactive "P") 783 (interactive "P")
784 ;; FIXME: the print-length/level bindings should only be applied while
785 ;; printing, not while evaluating.
786 (let ((debug-on-error eval-expression-debug-on-error) 786 (let ((debug-on-error eval-expression-debug-on-error)
787 (print-length eval-expression-print-length) 787 (print-length eval-expression-print-length)
788 (print-level eval-expression-print-level)) 788 (print-level eval-expression-print-level))
789 (save-excursion 789 (save-excursion
790 ;; Arrange for eval-region to "read" the (possibly) altered form. 790 ;; Arrange for eval-region to "read" the (possibly) altered form.
853 value))))) 853 value)))))
854 854
855 ;; May still be used by some external Lisp-mode variant. 855 ;; May still be used by some external Lisp-mode variant.
856 (define-obsolete-function-alias 'lisp-comment-indent 856 (define-obsolete-function-alias 'lisp-comment-indent
857 'comment-indent-default "22.1") 857 'comment-indent-default "22.1")
858 858 (define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1")
859 ;; This function just forces a more costly detection of comments (using
860 ;; parse-partial-sexp from beginning-of-defun). I.e. It avoids the problem of
861 ;; taking a `;' inside a string started on another line for a comment starter.
862 ;; Note: `newcomment' gets it right now since we set comment-use-global-state
863 ;; so we could get rid of it. -stef
864 (defun lisp-mode-auto-fill ()
865 (if (> (current-column) (current-fill-column))
866 (if (save-excursion
867 (nth 4 (syntax-ppss (point))))
868 (do-auto-fill)
869 (unless (and (boundp 'comment-auto-fill-only-comments)
870 comment-auto-fill-only-comments)
871 (let ((comment-start nil) (comment-start-skip nil))
872 (do-auto-fill))))))
873 859
874 (defcustom lisp-indent-offset nil 860 (defcustom lisp-indent-offset nil
875 "If non-nil, indent second line of expressions that many more columns." 861 "If non-nil, indent second line of expressions that many more columns."
876 :group 'lisp 862 :group 'lisp
877 :type '(choice nil integer)) 863 :type '(choice nil integer))