Fix handling of hook variables in 'use-package'
* lisp/use-package/use-package-core.el (use-package-handler/:hook): Append "-hook" to the symbol's name only if the named hook variable has no 'symbol-value'. (Bug#72818)
This commit is contained in:
parent
bb5576fc90
commit
4f521fa14c
1 changed files with 7 additions and 5 deletions
|
@ -1376,11 +1376,13 @@ enable gathering statistics."
|
|||
(when fun
|
||||
(mapcar
|
||||
#'(lambda (sym)
|
||||
`(add-hook
|
||||
(quote ,(intern
|
||||
(concat (symbol-name sym)
|
||||
use-package-hook-name-suffix)))
|
||||
(function ,fun)))
|
||||
(if (boundp sym)
|
||||
`(add-hook (quote ,sym) (function ,fun))
|
||||
`(add-hook
|
||||
(quote ,(intern
|
||||
(concat (symbol-name sym)
|
||||
use-package-hook-name-suffix)))
|
||||
(function ,fun))))
|
||||
(use-package-hook-handler-normalize-mode-symbols syms)))))
|
||||
(use-package-normalize-commands args))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue