[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r100071: Make it possible to locally
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r100071: Make it possible to locally disable a globally enabled mode. |
Date: |
Wed, 28 Apr 2010 11:18:37 -0400 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100071
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2010-04-28 11:18:37 -0400
message:
Make it possible to locally disable a globally enabled mode.
* simple.el (fundamental-mode): Run fundamental-mode-hook.
* emacs-lisp/derived.el (define-derived-mode): Use fundamental-mode
rather than kill-all-local-variables so it runs fundamental-mode-hook.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Use fundamental-mode-hook to run MODE-enable-in-buffers earlier, so
that subsequent hooks get a chance to disable it.
modified:
lisp/ChangeLog
lisp/emacs-lisp/derived.el
lisp/emacs-lisp/easy-mmode.el
lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-04-27 18:14:16 +0000
+++ b/lisp/ChangeLog 2010-04-28 15:18:37 +0000
@@ -1,3 +1,13 @@
+2010-04-28 Stefan Monnier <address@hidden>
+
+ Make it possible to locally disable a globally enabled mode.
+ * simple.el (fundamental-mode): Run fundamental-mode-hook.
+ * emacs-lisp/derived.el (define-derived-mode): Use fundamental-mode
+ rather than kill-all-local-variables so it runs fundamental-mode-hook.
+ * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
+ Use fundamental-mode-hook to run MODE-enable-in-buffers earlier, so
+ that subsequent hooks get a chance to disable it.
+
2010-04-27 Stefan Monnier <address@hidden>
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
=== modified file 'lisp/emacs-lisp/derived.el'
--- a/lisp/emacs-lisp/derived.el 2010-01-13 08:35:10 +0000
+++ b/lisp/emacs-lisp/derived.el 2010-04-28 15:18:37 +0000
@@ -230,7 +230,7 @@
; Run the parent.
(delay-mode-hooks
- (,(or parent 'kill-all-local-variables))
+ (,(or parent 'fundamental-mode))
; Identify the child mode.
(setq major-mode (quote ,child))
(setq mode-name ,name)
=== modified file 'lisp/emacs-lisp/easy-mmode.el'
--- a/lisp/emacs-lisp/easy-mmode.el 2010-04-27 18:14:16 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el 2010-04-28 15:18:37 +0000
@@ -338,9 +338,11 @@
(progn
(add-hook 'after-change-major-mode-hook
',MODE-enable-in-buffers)
+ (add-hook 'fundamental-mode-hook ',MODE-enable-in-buffers)
(add-hook 'find-file-hook ',MODE-check-buffers)
(add-hook 'change-major-mode-hook ',MODE-cmhh))
(remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers)
+ (remove-hook 'fundamental-mode-hook ',MODE-enable-in-buffers)
(remove-hook 'find-file-hook ',MODE-check-buffers)
(remove-hook 'change-major-mode-hook ',MODE-cmhh))
=== modified file 'lisp/simple.el'
--- a/lisp/simple.el 2010-04-16 01:41:58 +0000
+++ b/lisp/simple.el 2010-04-28 15:18:37 +0000
@@ -401,8 +401,7 @@
Other major modes are defined by comparison with this one."
(interactive)
(kill-all-local-variables)
- (unless delay-mode-hooks
- (run-hooks 'after-change-major-mode-hook)))
+ (run-mode-hooks 'fundamental-mode-hook))
;; Special major modes to view specially formatted data rather than files.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r100071: Make it possible to locally disable a globally enabled mode.,
Stefan Monnier <=