From 6d9ac082df6364ee19b251124f2ea291e7481651 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Tue, 21 Sep 2004 00:40:06 +0000 Subject: [PATCH] (run-mode-hooks): Run `after-change-major-mode-hook' after the mode-hooks instead of before. Doc fix. --- lisp/ChangeLog | 9 +++++++-- lisp/subr.el | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 88cebb15340..20a2f5987bd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-09-20 Luc Teirlinck + + * subr.el (run-mode-hooks): Run `after-change-major-mode-hook' + after the mode-hooks instead of before. Doc fix. + 2004-09-20 Jason Rumney * startup.el (command-line) [windows-nt]: Try .emacs first, then @@ -20,9 +25,9 @@ * eshell/esh-ext.el (eshell-explicit-command-char): Doc fix. - * progmodes/make-mode.el (makefile-fill-paragraph): + * progmodes/make-mode.el (makefile-fill-paragraph): Don't insist on spaces when looking for comments. # is enough. - + * files.el (hack-local-variables): Copy the variables list to another buffer, strip prefixes and suffixes there, then read. (enable-local-eval): Doc fix. diff --git a/lisp/subr.el b/lisp/subr.el index d7bfcc1f7fe..cb8f76bc070 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1944,6 +1944,8 @@ This is run just before the mode dependent hooks.") (defun run-mode-hooks (&rest hooks) "Run mode hooks `delayed-mode-hooks' and HOOKS, or delay HOOKS. Execution is delayed if `delay-mode-hooks' is non-nil. +If `delay-mode-hooks' is nil, run `after-change-major-mode-hook' +after running the mode hooks. Major mode functions should use this." (if delay-mode-hooks ;; Delaying case. @@ -1952,8 +1954,8 @@ Major mode functions should use this." ;; Normal case, just run the hook as before plus any delayed hooks. (setq hooks (nconc (nreverse delayed-mode-hooks) hooks)) (setq delayed-mode-hooks nil) - (run-hooks 'after-change-major-mode-hook) - (apply 'run-hooks hooks))) + (apply 'run-hooks hooks) + (run-hooks 'after-change-major-mode-hook))) (defmacro delay-mode-hooks (&rest body) "Execute BODY, but delay any `run-mode-hooks'. -- 2.39.2