aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPhil Sainty2019-04-23 11:00:02 +1200
committerPhil Sainty2019-04-23 11:07:28 +1200
commit95cea37fcd7494d9d9c63eda569c6cbd5bde9a03 (patch)
tree7d6053a21a41f079801f454f1ebdd9893b188ee3 /lisp/emacs-lisp
parent196b9760e3218c19478628213796900e35fffb74 (diff)
downloademacs-fix/bug-35351.tar.gz
emacs-fix/bug-35351.zip
fixup! Add :before-hook keyword to define-derived-modefix/bug-35351
Run :before-hook right away, rather than using change-major-mode-hook. This changes the :before-hook sequence to child-before-parent rather than parent-before-child.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/derived.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 00aa70a10aa..6934d1d087d 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -139,7 +139,8 @@ BODY can start with a bunch of keyword arguments. The following keyword
139 A nil value means to simply use the same abbrev-table as the parent. 139 A nil value means to simply use the same abbrev-table as the parent.
140:before-hook FORM 140:before-hook FORM
141 A single lisp form which will be evaluated before anything else 141 A single lisp form which will be evaluated before anything else
142 happens in `change-major-mode-hook'. It should not be quoted. 142 happens (i.e. before `change-major-mode-hook'). It should not be
143 quoted.
143:after-hook FORM 144:after-hook FORM
144 A single lisp form which is evaluated after the mode hooks have been 145 A single lisp form which is evaluated after the mode hooks have been
145 run. It should not be quoted. 146 run. It should not be quoted.
@@ -247,8 +248,7 @@ No problems result if this variable is not bound.
247 ,docstring 248 ,docstring
248 (interactive) 249 (interactive)
249 ,@(when before-hook 250 ,@(when before-hook
250 `((add-hook 'change-major-mode-hook (lambda () ,before-hook) 251 `(,before-hook))
251 nil t)))
252 ; Run the parent. 252 ; Run the parent.
253 (delay-mode-hooks 253 (delay-mode-hooks
254 254