diff options
| author | Stefan Monnier | 2019-05-29 15:56:14 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-05-29 15:56:14 -0400 |
| commit | fe0cb43fb80db52a79ef898f8de49560cc5cdd90 (patch) | |
| tree | 4825956db223eb96d69583e707cbf13a4d280789 /etc | |
| parent | 49cdbb4a35f8d1d2139e8469bffcf33f65679094 (diff) | |
| download | emacs-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/NEWS | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -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. | ||
| 1513 | The replacement of `append` with `depth` implies that the function is not | ||
| 1514 | always added to the very front (when append/depth is nil) or the very end (when | ||
| 1515 | append/depth is t) any more because other functions on the hook may have | ||
| 1516 | specified higher/lower depths. | ||
| 1517 | |||
| 1511 | ** In 'compilation-error-regexp-alist' the old undocumented feature | 1518 | ** In 'compilation-error-regexp-alist' the old undocumented feature |
| 1512 | where 'line' could be a function of 2 arguments has been dropped. | 1519 | where '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' | ||
| 1651 | This makes it possible to control the ordering of functions more precisely, | ||
| 1652 | as 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. |
| 1643 | Makes it possible to add metadata information to 'describe-variable'. | 1656 | Makes it possible to add metadata information to 'describe-variable'. |
| 1644 | 1657 | ||