aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/easy-mmode.el
diff options
context:
space:
mode:
authorMiles Bader <[email protected]>2007-10-09 08:52:57 +0000
committerMiles Bader <[email protected]>2007-10-09 08:52:57 +0000
commit1af74d06e5bdafad9d629d2ed729c5d743cfaf0f (patch)
tree0360965ec0ad2736ffee01cce4f040c6b0a99133 /lisp/emacs-lisp/easy-mmode.el
parenteceb3266a1f66a0034954aa82efbb20a5be959f8 (diff)
parent4b70e299ef66906fd285198003c72a1439d1f252 (diff)
Merge from emacs--rel--22
Revision: [email protected]/emacs--devo--0--patch-875
Diffstat (limited to 'lisp/emacs-lisp/easy-mmode.el')
-rw-r--r--lisp/emacs-lisp/easy-mmode.el52
1 files changed, 27 insertions, 25 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 8d4274d63a..da0b76808d 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