According to the use-package documentation these two are the same:
(use-package ace-jump-mode
:hook (prog-mode . ace-jump-mode))
(use-package ace-jump-mode
:commands ace-jump-mode
:init
(add-hook 'prog-mode-hook #'ace-jump-mode))
I have the following in my configs:
(use-package auctex
:ensure t
:after latex
:init
[snip]
(add-hook
'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer)
:hook
;; (TeX-after-compilation-finished-functions . TeX-revert-document-buffer) ; Causes errors?
[snip]
If I take out the add-hook
way and uncomments the :hook
way then I get the following errors each time I compile a latex document followed by a subsequent pdf buffer revert:
error in process sentinel: image-display-size: Invalid image specification: nil
error in process sentinel: Invalid image specification: nil
Note that when I define the hooks using add-hook
, that does not produce the errors.
Could someone tell what's going on?