[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r100061: Let the user turn off locall
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r100061: Let the user turn off locally a globalized minor mode |
Date: |
Tue, 27 Apr 2010 14:14:16 -0400 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100061
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2010-04-27 14:14:16 -0400
message:
Let the user turn off locally a globalized minor mode
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Avoid re-enabling a minor mode after the user turned the minor mode
off if MODE-enable-in-buffers is run twice (typically once from
fundamental-mode's after-change-major-mode-hook and a second time from
run-mode-hook's own after-change-major-mode-hook).
modified:
lisp/ChangeLog
lisp/emacs-lisp/easy-mmode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-04-27 17:57:32 +0000
+++ b/lisp/ChangeLog 2010-04-27 18:14:16 +0000
@@ -1,5 +1,11 @@
2010-04-27 Stefan Monnier <address@hidden>
+ * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
+ Avoid re-enabling a minor mode after the user turned the minor mode
+ off if MODE-enable-in-buffers is run twice (typically once from
+ fundamental-mode's after-change-major-mode-hook and a second time from
+ run-mode-hook's own after-change-major-mode-hook).
+
* emacs-lisp/lisp.el (lisp-complete-symbol): Fail gracefully.
2010-04-27 Sam Steingold <address@hidden>
=== modified file 'lisp/emacs-lisp/easy-mmode.el'
--- a/lisp/emacs-lisp/easy-mmode.el 2010-04-13 01:03:04 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el 2010-04-27 18:14:16 +0000
@@ -361,13 +361,14 @@
(dolist (buf ,MODE-buffers)
(when (buffer-live-p buf)
(with-current-buffer buf
- (if ,mode
- (unless (eq ,MODE-major-mode major-mode)
- (,mode -1)
- (,turn-on)
- (setq ,MODE-major-mode major-mode))
- (,turn-on)
- (setq ,MODE-major-mode major-mode))))))
+ (unless (eq ,MODE-major-mode major-mode)
+ (if ,mode
+ (progn
+ (,mode -1)
+ (,turn-on)
+ (setq ,MODE-major-mode major-mode))
+ (,turn-on)
+ (setq ,MODE-major-mode major-mode)))))))
(put ',MODE-enable-in-buffers 'definition-name ',global-mode)
(defun ,MODE-check-buffers ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r100061: Let the user turn off locally a globalized minor mode,
Stefan Monnier <=