aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorStefan Monnier2019-05-29 15:56:14 -0400
committerStefan Monnier2019-05-29 15:56:14 -0400
commitfe0cb43fb80db52a79ef898f8de49560cc5cdd90 (patch)
tree4825956db223eb96d69583e707cbf13a4d280789 /etc
parent49cdbb4a35f8d1d2139e8469bffcf33f65679094 (diff)
downloademacs-fe0cb43fb80db52a79ef898f8de49560cc5cdd90.tar.gz
emacs-fe0cb43fb80db52a79ef898f8de49560cc5cdd90.zip
* lisp/subr.el (add-hook): Turn `append` into `depth` (bug#35508)
Make it possible to control the relative ordering of functions on hooks by specifying `depth` in the same was as was possible with `add-function`. * lisp/electric.el (electric--sort-post-self-insertion-hook): Delete function. (electric-indent-mode, electric-layout-mode, electric-quote-mode): * lisp/elec-pair.el (electric-pair-mode): Use new `depth` arg instead of electric--sort-post-self-insertion-hook. * lisp/emacs-lisp/syntax.el (syntax-propertize, syntax-ppss): Use new `depth` arg to make sure noone accidentally gets added after syntax-ppss-flush-cache. * doc/lispref/modes.texi (Setting Hooks): Document new `depth` arg. * test/lisp/subr-tests.el (subr-tests-add-hook-depth): New test.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS13
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 222b86ee2b3..a2306c06f69 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1508,6 +1508,13 @@ documentation of the new mode and its commands.
1508 1508
1509* Incompatible Lisp Changes in Emacs 27.1 1509* Incompatible Lisp Changes in Emacs 27.1
1510 1510
1511+++
1512** add-hook does not always add to the front or the end any more.
1513The replacement of `append` with `depth` implies that the function is not
1514always added to the very front (when append/depth is nil) or the very end (when
1515append/depth is t) any more because other functions on the hook may have
1516specified higher/lower depths.
1517
1511** In 'compilation-error-regexp-alist' the old undocumented feature 1518** In 'compilation-error-regexp-alist' the old undocumented feature
1512where 'line' could be a function of 2 arguments has been dropped. 1519where 'line' could be a function of 2 arguments has been dropped.
1513 1520
@@ -1639,6 +1646,12 @@ valid event type.
1639 1646
1640* Lisp Changes in Emacs 27.1 1647* Lisp Changes in Emacs 27.1
1641 1648
1649+++
1650** The 'append' arg of 'add-hook' is generalized to a finer notion of 'depth'
1651This makes it possible to control the ordering of functions more precisely,
1652as was already possible in 'add-function' and `advice-add`.
1653
1654---
1642** New 'help-fns-describe-variable-functions' hook. 1655** New 'help-fns-describe-variable-functions' hook.
1643Makes it possible to add metadata information to 'describe-variable'. 1656Makes it possible to add metadata information to 'describe-variable'.
1644 1657