diff options
| author | Stefan Kangas | 2021-10-23 20:03:34 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2021-10-23 20:03:34 +0200 |
| commit | 4fd5c8df67e2eb41dd0ea6d95586bbd8d09cc482 (patch) | |
| tree | 398be37af2cd86e7967c6871796038856240ab13 | |
| parent | 6fa520677095c5872f1d448f6f1001ee22e42276 (diff) | |
| download | emacs-4fd5c8df67e2eb41dd0ea6d95586bbd8d09cc482.tar.gz emacs-4fd5c8df67e2eb41dd0ea6d95586bbd8d09cc482.zip | |
Clarify abnormal hook documentation
* doc/lispref/hooks.texi (Standard Hooks):
* doc/lispref/modes.texi (Hooks): Clarify wording of "abnormal
hook" documentation. (Bug#34588)
| -rw-r--r-- | doc/lispref/hooks.texi | 12 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 12 |
2 files changed, 13 insertions, 11 deletions
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi index feec8b24f46..e9d1e270d8e 100644 --- a/doc/lispref/hooks.texi +++ b/doc/lispref/hooks.texi | |||
| @@ -18,11 +18,13 @@ arguments and their values are completely ignored. The recommended way | |||
| 18 | to put a new function on such a hook is to call @code{add-hook}. | 18 | to put a new function on such a hook is to call @code{add-hook}. |
| 19 | @xref{Hooks}, for more information about using hooks. | 19 | @xref{Hooks}, for more information about using hooks. |
| 20 | 20 | ||
| 21 | The variables whose names end in @samp{-functions} are usually @dfn{abnormal | 21 | The variables whose names end in @samp{-functions} are usually |
| 22 | hooks} (some old code may also use the deprecated @samp{-hooks} suffix); their | 22 | @dfn{abnormal hooks} (some old code may also use the deprecated |
| 23 | values are lists of functions, but these functions are called in a special way | 23 | @samp{-hooks} suffix). Their values are lists of functions, but these |
| 24 | (they are passed arguments, or their return values are used). The variables | 24 | functions are called in a special way: they are either passed |
| 25 | whose names end in @samp{-function} have single functions as their values. | 25 | arguments, or their return values are used in some way. The variables |
| 26 | whose names end in @samp{-function} have single functions as their | ||
| 27 | values. | ||
| 26 | 28 | ||
| 27 | This is not an exhaustive list, it only covers the more general hooks. | 29 | This is not an exhaustive list, it only covers the more general hooks. |
| 28 | For example, every major mode defines a hook named | 30 | For example, every major mode defines a hook named |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index ee55f982d02..ed0c535867f 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -59,12 +59,12 @@ runs just before Emacs suspends itself (@pxref{Suspending Emacs}). | |||
| 59 | 59 | ||
| 60 | @cindex abnormal hook | 60 | @cindex abnormal hook |
| 61 | If the hook variable's name does not end with @samp{-hook}, that | 61 | If the hook variable's name does not end with @samp{-hook}, that |
| 62 | indicates it is probably an @dfn{abnormal hook}. That means the hook | 62 | indicates it is probably an @dfn{abnormal hook}. That means one of |
| 63 | functions are called with arguments, or their return values are used | 63 | two things: either that the hook functions are called with arguments, |
| 64 | in some way. The hook's documentation says how the functions are | 64 | or that their return values are used in some way. The hook's |
| 65 | called. Any functions added to an abnormal hook must follow the | 65 | documentation says how the functions are called. Any functions added |
| 66 | hook's calling convention. By convention, abnormal hook names end in | 66 | to an abnormal hook must follow the hook's calling convention. By |
| 67 | @samp{-functions}. | 67 | convention, abnormal hook names end in @samp{-functions}. |
| 68 | 68 | ||
| 69 | @cindex single-function hook | 69 | @cindex single-function hook |
| 70 | If the name of the variable ends in @samp{-predicate} or | 70 | If the name of the variable ends in @samp{-predicate} or |