comparison lisp/emacs-lisp/lisp-mode.el @ 66747:d7776140d845

(lisp-mode-variables): Don't set comment-indent-function. (lisp-comment-indent): Replace by an alias for comment-indent-default.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 08 Nov 2005 01:46:37 +0000
parents 48fff88992ce
children 249c0ac46fca
comparison
equal deleted inserted replaced
66746:2a26902fb8a4 66747:d7776140d845
231 (setq comment-add 1) ;default to `;;' in comment-region 231 (setq comment-add 1) ;default to `;;' in comment-region
232 (make-local-variable 'comment-column) 232 (make-local-variable 'comment-column)
233 (setq comment-column 40) 233 (setq comment-column 40)
234 ;; Don't get confused by `;' in doc strings when paragraph-filling. 234 ;; Don't get confused by `;' in doc strings when paragraph-filling.
235 (set (make-local-variable 'comment-use-global-state) t) 235 (set (make-local-variable 'comment-use-global-state) t)
236 (make-local-variable 'comment-indent-function)
237 (setq comment-indent-function 'lisp-comment-indent)
238 (make-local-variable 'imenu-generic-expression) 236 (make-local-variable 'imenu-generic-expression)
239 (setq imenu-generic-expression lisp-imenu-generic-expression) 237 (setq imenu-generic-expression lisp-imenu-generic-expression)
240 (make-local-variable 'multibyte-syntax-as-symbol) 238 (make-local-variable 'multibyte-syntax-as-symbol)
241 (setq multibyte-syntax-as-symbol t) 239 (setq multibyte-syntax-as-symbol t)
242 (set (make-local-variable 'syntax-begin-function) 'beginning-of-defun) 240 (set (make-local-variable 'syntax-begin-function) 'beginning-of-defun)
744 (setq value (eval-defun-2)) 742 (setq value (eval-defun-2))
745 (setq new-value debug-on-error)) 743 (setq new-value debug-on-error))
746 (unless (eq old-value new-value) 744 (unless (eq old-value new-value)
747 (setq debug-on-error new-value)) 745 (setq debug-on-error new-value))
748 value))))) 746 value)))))
749 747
750 ;; Used for comment-indent-function in Lisp modes. 748 ;; May still be used by some external Lisp-mode variant.
751 (defun lisp-comment-indent () 749 (define-obsolete-function-alias 'lisp-comment-indent 'comment-indent-default)
752 (if (looking-at "\\s<\\s<\\s<")
753 (current-column)
754 (if (looking-at "\\s<\\s<")
755 (let ((tem (or (calculate-lisp-indent) (current-column))))
756 (if (listp tem) (car tem) tem))
757 (skip-chars-backward " \t")
758 (max (if (bolp) 0 (1+ (current-column)))
759 comment-column))))
760 750
761 ;; This function just forces a more costly detection of comments (using 751 ;; This function just forces a more costly detection of comments (using
762 ;; parse-partial-sexp from beginning-of-defun). I.e. It avoids the problem of 752 ;; parse-partial-sexp from beginning-of-defun). I.e. It avoids the problem of
763 ;; taking a `;' inside a string started on another line for a comment starter. 753 ;; taking a `;' inside a string started on another line for a comment starter.
764 ;; Note: `newcomment' gets it right now since we set comment-use-global-state 754 ;; Note: `newcomment' gets it right now since we set comment-use-global-state