mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 11:23:24 +00:00
Fix documentation of use-package's ':hook' keyword
* doc/misc/use-package.texi (Hooks): Document how to add several functions to the same hook (bug#77609).
This commit is contained in:
parent
d0c90bc9bf
commit
36afdd2f6f
1 changed files with 12 additions and 2 deletions
|
@ -1191,8 +1191,7 @@ keybindings you've set using either the @code{:bind} keyword or the
|
|||
@cindex hooks
|
||||
@findex :hook
|
||||
The @code{:hook} keyword allows adding functions to hooks. It takes
|
||||
@c FIXME: The actual forms accepted by :hook are different, see below!
|
||||
one argument of the form @var{hooks}, specifying one or more functions
|
||||
one argument of the form @var{hooks}, specifying or more functions
|
||||
to add to one or more hooks. For the purposes of @code{:hook}, the
|
||||
name of hook variables should always exclude the @samp{-hook} suffix.
|
||||
It is appended automatically for you, to save some typing.
|
||||
|
@ -1265,6 +1264,17 @@ applied, the following examples are all equivalent:
|
|||
@end group
|
||||
@end lisp
|
||||
|
||||
To add more than one function to the same hook, add them separately,
|
||||
like this:
|
||||
|
||||
@lisp
|
||||
@group
|
||||
(use-package company
|
||||
:hook ((prog-mode . company-mode)
|
||||
(prog-mode . some-other-function)))
|
||||
@end group
|
||||
@end lisp
|
||||
|
||||
One common mistake when using @code{:hook} is to forget to omit the
|
||||
@samp{-hook} suffix, which, as already explained, is appended
|
||||
automatically. Therefore, the following will not work, as it attempts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue