diff options
author | Miles Bader <miles@gnu.org> | 2007-10-09 08:52:57 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-10-09 08:52:57 +0000 |
commit | 1af74d06e5bdafad9d629d2ed729c5d743cfaf0f (patch) | |
tree | 0360965ec0ad2736ffee01cce4f040c6b0a99133 /lisp/emacs-lisp | |
parent | eceb3266a1f66a0034954aa82efbb20a5be959f8 (diff) | |
parent | 4b70e299ef66906fd285198003c72a1439d1f252 (diff) | |
download | emacs-1af74d06e5bdafad9d629d2ed729c5d743cfaf0f.tar.gz emacs-1af74d06e5bdafad9d629d2ed729c5d743cfaf0f.tar.bz2 emacs-1af74d06e5bdafad9d629d2ed729c5d743cfaf0f.zip |
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-875
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 52 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 16 |
2 files changed, 39 insertions, 29 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 8d4274d63a3..da0b76808d5 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -139,8 +139,8 @@ For example, you could write (setq body (list* lighter keymap body) lighter nil keymap nil)) ((keywordp keymap) (push keymap body) (setq keymap nil))) - (let* ((last-message (current-message)) - (mode-name (symbol-name mode)) + (let* ((last-message (make-symbol "last-message")) + (mode-name (symbol-name mode)) (pretty-name (easy-mmode-pretty-mode-name mode lighter)) (globalp nil) (set nil) @@ -222,28 +222,30 @@ With zero or negative ARG turn mode off. ;; Use `toggle' rather than (if ,mode 0 1) so that using ;; repeat-command still does the toggling correctly. (interactive (list (or current-prefix-arg 'toggle))) - (setq ,mode - (cond - ((eq arg 'toggle) (not ,mode)) - (arg (> (prefix-numeric-value arg) 0)) - (t - (if (null ,mode) t - (message - "Toggling %s off; better pass an explicit argument." - ',mode) - nil)))) - ,@body - ;; The on/off hooks are here for backward compatibility only. - (run-hooks ',hook (if ,mode ',hook-on ',hook-off)) - (if (called-interactively-p) - (progn - ,(if globalp `(customize-mark-as-set ',mode)) - ;; Avoid overwriting a message shown by the body, - ;; but do overwrite previous messages. - (unless ,(and (current-message) - (not (equal last-message (current-message)))) - (message ,(format "%s %%sabled" pretty-name) - (if ,mode "en" "dis"))))) + (let ((,last-message (current-message))) + (setq ,mode + (cond + ((eq arg 'toggle) (not ,mode)) + (arg (> (prefix-numeric-value arg) 0)) + (t + (if (null ,mode) t + (message + "Toggling %s off; better pass an explicit argument." + ',mode) + nil)))) + ,@body + ;; The on/off hooks are here for backward compatibility only. + (run-hooks ',hook (if ,mode ',hook-on ',hook-off)) + (if (called-interactively-p) + (progn + ,(if globalp `(customize-mark-as-set ',mode)) + ;; Avoid overwriting a message shown by the body, + ;; but do overwrite previous messages. + (unless (and (current-message) + (not (equal ,last-message + (current-message)))) + (message ,(format "%s %%sabled" pretty-name) + (if ,mode "en" "dis")))))) (force-mode-line-update) ;; Return the new setting. ,mode) @@ -539,5 +541,5 @@ found, do `widen' first and then call NARROWFUN with no args after moving." (provide 'easy-mmode) -;;; arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a +;; arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a ;;; easy-mmode.el ends here diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 9b7a1aaeeff..7eeefd349a9 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -784,8 +784,13 @@ which see." (let ((comment-start nil) (comment-start-skip nil)) (do-auto-fill)))))) -(defvar lisp-indent-offset nil - "If non-nil, indent second line of expressions that many more columns.") +(defcustom lisp-indent-offset nil + "If non-nil, indent second line of expressions that many more columns." + :group 'lisp + :type '(choice nil integer)) +(put 'lisp-body-indent 'safe-local-variable + (lambda (x) (or (null x) (integerp x)))) + (defvar lisp-indent-function 'lisp-indent-function) (defun lisp-indent-line (&optional whole-exp) @@ -1025,8 +1030,11 @@ This function also returns nil meaning don't specify the indentation." (method (funcall method indent-point state))))))) -(defvar lisp-body-indent 2 - "Number of columns to indent the second line of a `(def...)' form.") +(defcustom lisp-body-indent 2 + "Number of columns to indent the second line of a `(def...)' form." + :group 'lisp + :type 'integer) +(put 'lisp-body-indent 'safe-local-variable 'integerp) (defun lisp-indent-specform (count state indent-point normal-indent) (let ((containing-form-start (elt state 1)) |