Commit e427e513e864

Vincent Demeester <vincent@sbr.pm>
2020-08-19 16:01:06
tools/emacs: fix :hook and -hook mistake…
use-package with :hook adds a `-hook` to the name provided. This means, that if you want to add a function to `occur-mode-hook`, you need to use `:hook ((occur-mode . my-func))` (without `-hook`) Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent e5fcf21
tools/emacs/config/config-appearance.el
@@ -95,7 +95,7 @@ Ignores `ARGS'."
   (setq window-divider-default-right-width 1)
   (setq window-divider-default-bottom-width 1)
   (setq window-divider-default-places 'right-only)
-  :hook (after-init-hook . window-divider-mode))
+  :hook (after-init . window-divider-mode))
 ;; -UseWindowDivider
 
 ;; UseTabbar
tools/emacs/config/config-dired.el
@@ -231,7 +231,7 @@ This relies on the external 'fd' executable."
   :commands (diredfl-mode)
   :config
   (setq diredfl-ignore-compressed-flag nil)
-  :hook (dired-mode-hook . diredfl-mode))
+  :hook (dired-mode . diredfl-mode))
 
 (use-package trashed
   :commands (trashed)
tools/emacs/config/config-navigating.el
@@ -65,9 +65,9 @@ Meant to economise on key bindings."
         (vde/occur-url)
       (vde/occur-browse-url-in-buffer)))
 
-  :hook ((occur-mode-hook . hl-line-mode)
-         (occur-mode-hook . (lambda ()
-                              (toggle-truncate-lines t))))
+  :hook ((occur-mode . hl-line-mode)
+         (occur-mode . (lambda ()
+                         (toggle-truncate-lines t))))
   :bind (("M-s u" . vde/occur-visit-or-list-urls)
          ("M-s M-o" . multi-occur)
          :map occur-mode-map
@@ -139,11 +139,11 @@ aggressive fuzzy-style matching for this particular command."
       (icomplete-vertical-do (:height (/ (frame-height) 4))
         (call-interactively 'imenu))))
 
-  :hook ((imenu-after-jump-hook . (lambda ()
-                                    (when (and (eq major-mode 'org-mode)
-                                               (org-at-heading-p))
-                                      (org-show-entry)
-                                      (org-reveal t)))))
+  :hook ((imenu-after-jump . (lambda ()
+                               (when (and (eq major-mode 'org-mode)
+                                          (org-at-heading-p))
+                                 (org-show-entry)
+                                 (org-reveal t)))))
   :bind ("C-'" . prot/imenu-vertical))
 
 (use-package flimenu
tools/emacs/config/config-org.el
@@ -498,7 +498,7 @@ and thus keeping the configuration source up-to-date"
     (mapc (lambda (x) (org-babel-tangle-file x))
           (ignore-errors
             (directory-files-recursively org-notes-dir "\.org$"))))
-  :hook ((kill-emacs-hook . vde/tangle-all-notes)))
+  :hook ((kill-emacs . vde/tangle-all-notes)))
 (use-package org-journal
   :commands (org-journal-new-entry org-capture)
   :after (org-capture)
@@ -603,7 +603,7 @@ and thus keeping the configuration source up-to-date"
     (mapc (lambda (x) (org-babel-tangle-file x))
           (ignore-errors
             (directory-files-recursively org-notes-dir "\.org$"))))
-  :hook ((kill-emacs-hook . vde/tangle-all-notes)))
+  :hook ((kill-emacs . vde/tangle-all-notes)))
 
 (use-package org
   :defer t