aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2010-04-28 11:18:37 -0400
committerStefan Monnier <[email protected]>2010-04-28 11:18:37 -0400
commit56924d996f1ed21fdcfedd80792a5fe718b3f831 (patch)
treeff1484bbd413ba9faffd9a9b20e6f6a1a7b16e84 /lisp/emacs-lisp
parent106c6f743273e9119c0a38f79e7aaf3df3596c51 (diff)
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/derived.el2
-rw-r--r--lisp/emacs-lisp/easy-mmode.el2
2 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index debef5535f..d6f717ccda 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -230,7 +230,7 @@ No problems result if this variable is not bound.
; 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)
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index d18aa230b7..bebff6adae 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -338,9 +338,11 @@ See `%s' for more information on %s."
(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))