changeset 57176:2da0a6d97b14

(run-mode-hooks): Run `after-change-major-mode-hook' after the mode-hooks instead of before. Doc fix.
author Luc Teirlinck <teirllm@auburn.edu>
date Tue, 21 Sep 2004 00:37:22 +0000
parents e0ab3b50dc85
children b4cd85fb44e5
files lisp/subr.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Tue Sep 21 00:16:25 2004 +0000
+++ b/lisp/subr.el	Tue Sep 21 00:37:22 2004 +0000
@@ -1944,6 +1944,8 @@
 (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 @@
     ;; 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'.