@@ -401,13 +401,10 @@ string `"%PDF"`.
401
401
402
402
## Hooks
403
403
404
- The ` :hook ` keyword allows adding functions onto package hooks. Thus,
405
- all of the following are equivalent:
404
+ The ` :hook ` keyword allows adding functions onto package hooks. The
405
+ following are equivalent:
406
406
407
407
``` elisp
408
- (use-package company
409
- :hook prog-mode)
410
-
411
408
(use-package company
412
409
:hook (prog-mode . company-mode))
413
410
@@ -417,29 +414,35 @@ all of the following are equivalent:
417
414
(add-hook 'prog-mode-hook #'company-mode))
418
415
```
419
416
420
- And likewise, when multiple hooks should be applied, the following are also
421
- equivalent:
417
+ And likewise, when multiple hooks should be applied, all of the
418
+ following are also equivalent:
422
419
423
420
``` elisp
424
- (use-package company
425
- :hook (prog-mode text-mode))
426
-
427
421
(use-package company
428
422
:hook ((prog-mode text-mode) . company-mode))
429
423
430
424
(use-package company
431
425
:hook ((prog-mode . company-mode)
432
426
(text-mode . company-mode)))
433
427
428
+ (use-package company
429
+ :hook (prog-mode . company-mode)
430
+ :hook (text-mode . company-mode))
431
+
432
+ (use-package company
433
+ :hook
434
+ (prog-mode . company-mode)
435
+ (text-mode . company-mode))
436
+
434
437
(use-package company
435
438
:commands company-mode
436
439
:init
437
440
(add-hook 'prog-mode-hook #'company-mode)
438
441
(add-hook 'text-mode-hook #'company-mode))
439
442
```
440
443
441
- When using ` :hook ` omit the "-hook" suffix if you specify the hook
442
- explicitly, as this is appended by default. For example the following
444
+ When using ` :hook ` , omit the "-hook" suffix if you specify the hook
445
+ explicitly, as this is appended by default. For example, the following
443
446
code will not work as it attempts to add to the ` prog-mode-hook-hook `
444
447
which does not exist:
445
448
0 commit comments