Skip to content

Commit a6e8564

Browse files
committed
Update README and NEWS to reflect most recent commit
1 parent b59b4dc commit a6e8564

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changes
22

3+
## 2.4.5
4+
5+
This is mostly a bug-fix release:
6+
7+
- When `:hook` is using in the form `(use-package foo :hook bar)`,
8+
this is once again equivalent to
9+
`(use-package foo :hook (bar . foo))` and no longer the same as
10+
`(use-package foo :hook (bar . foo-mode))`.
11+
312
## 2.4.4
413

514
This release prepares for inclusion to GNU ELPA and includes no other changes

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,10 @@ string `"%PDF"`.
401401

402402
## Hooks
403403

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:
406406

407407
``` elisp
408-
(use-package company
409-
:hook prog-mode)
410-
411408
(use-package company
412409
:hook (prog-mode . company-mode))
413410
@@ -417,29 +414,35 @@ all of the following are equivalent:
417414
(add-hook 'prog-mode-hook #'company-mode))
418415
```
419416

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:
422419

423420
``` elisp
424-
(use-package company
425-
:hook (prog-mode text-mode))
426-
427421
(use-package company
428422
:hook ((prog-mode text-mode) . company-mode))
429423
430424
(use-package company
431425
:hook ((prog-mode . company-mode)
432426
(text-mode . company-mode)))
433427
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+
434437
(use-package company
435438
:commands company-mode
436439
:init
437440
(add-hook 'prog-mode-hook #'company-mode)
438441
(add-hook 'text-mode-hook #'company-mode))
439442
```
440443

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
443446
code will not work as it attempts to add to the `prog-mode-hook-hook`
444447
which does not exist:
445448

0 commit comments

Comments
 (0)