comparison lisp/simple.el @ 108154:cede0252a395

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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 28 Apr 2010 11:18:37 -0400
parents b22d92cb789e
children 41a25ee89427
comparison
equal deleted inserted replaced
108153:533b15049ee7 108154:cede0252a395
399 (defun fundamental-mode () 399 (defun fundamental-mode ()
400 "Major mode not specialized for anything in particular. 400 "Major mode not specialized for anything in particular.
401 Other major modes are defined by comparison with this one." 401 Other major modes are defined by comparison with this one."
402 (interactive) 402 (interactive)
403 (kill-all-local-variables) 403 (kill-all-local-variables)
404 (unless delay-mode-hooks 404 (run-mode-hooks 'fundamental-mode-hook))
405 (run-hooks 'after-change-major-mode-hook)))
406 405
407 ;; Special major modes to view specially formatted data rather than files. 406 ;; Special major modes to view specially formatted data rather than files.
408 407
409 (defvar special-mode-map 408 (defvar special-mode-map
410 (let ((map (make-sparse-keymap))) 409 (let ((map (make-sparse-keymap)))