diff options
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/use-package.texi | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi index c14e7b77d23..69dd68d7f3a 100644 --- a/doc/misc/use-package.texi +++ b/doc/misc/use-package.texi | |||
| @@ -1191,8 +1191,7 @@ keybindings you've set using either the @code{:bind} keyword or the | |||
| 1191 | @cindex hooks | 1191 | @cindex hooks |
| 1192 | @findex :hook | 1192 | @findex :hook |
| 1193 | The @code{:hook} keyword allows adding functions to hooks. It takes | 1193 | The @code{:hook} keyword allows adding functions to hooks. It takes |
| 1194 | @c FIXME: The actual forms accepted by :hook are different, see below! | 1194 | one argument of the form @var{hooks}, specifying or more functions |
| 1195 | one argument of the form @var{hooks}, specifying one or more functions | ||
| 1196 | to add to one or more hooks. For the purposes of @code{:hook}, the | 1195 | to add to one or more hooks. For the purposes of @code{:hook}, the |
| 1197 | name of hook variables should always exclude the @samp{-hook} suffix. | 1196 | name of hook variables should always exclude the @samp{-hook} suffix. |
| 1198 | It is appended automatically for you, to save some typing. | 1197 | It is appended automatically for you, to save some typing. |
| @@ -1265,6 +1264,17 @@ applied, the following examples are all equivalent: | |||
| 1265 | @end group | 1264 | @end group |
| 1266 | @end lisp | 1265 | @end lisp |
| 1267 | 1266 | ||
| 1267 | To add more than one function to the same hook, add them separately, | ||
| 1268 | like this: | ||
| 1269 | |||
| 1270 | @lisp | ||
| 1271 | @group | ||
| 1272 | (use-package company | ||
| 1273 | :hook ((prog-mode . company-mode) | ||
| 1274 | (prog-mode . some-other-function))) | ||
| 1275 | @end group | ||
| 1276 | @end lisp | ||
| 1277 | |||
| 1268 | One common mistake when using @code{:hook} is to forget to omit the | 1278 | One common mistake when using @code{:hook} is to forget to omit the |
| 1269 | @samp{-hook} suffix, which, as already explained, is appended | 1279 | @samp{-hook} suffix, which, as already explained, is appended |
| 1270 | automatically. Therefore, the following will not work, as it attempts | 1280 | automatically. Therefore, the following will not work, as it attempts |