Use add-hook! for inline hook defuns
This commit is contained in:
parent
fe5d285a50
commit
09d13fd60d
3 changed files with 10 additions and 10 deletions
|
@ -59,7 +59,7 @@ directives. By default, this only recognizes C directives.")
|
|||
(advice-add #'help-with-tutorial :after (lambda (&rest _) (evil-emacs-state +1)))
|
||||
|
||||
;; Done in a hook to ensure the popup rules load as late as possible
|
||||
(add-hook 'doom-init-modules-hook
|
||||
(add-hook! 'doom-init-modules-hook
|
||||
(defun +evil--init-popup-rules-h ()
|
||||
(set-popup-rules!
|
||||
'(("^\\*evil-registers" :size 0.3)
|
||||
|
@ -71,7 +71,7 @@ directives. By default, this only recognizes C directives.")
|
|||
(defvar +evil--default-cursor-color "#ffffff")
|
||||
(defvar +evil--emacs-cursor-color "#ff9999")
|
||||
|
||||
(add-hook 'doom-load-theme-hook
|
||||
(add-hook! 'doom-load-theme-hook
|
||||
(defun +evil-update-cursor-color-h ()
|
||||
(setq +evil--default-cursor-color (face-background 'cursor)
|
||||
+evil--emacs-cursor-color (face-foreground 'warning))))
|
||||
|
@ -90,7 +90,7 @@ directives. By default, this only recognizes C directives.")
|
|||
;; `evil-delete' in wgrep buffers.
|
||||
(define-key wgrep-mode-map [remap evil-delete] #'+evil-delete))
|
||||
|
||||
(add-hook 'doom-escape-hook
|
||||
(add-hook! 'doom-escape-hook
|
||||
(defun +evil-disable-ex-highlights-h ()
|
||||
"Disable ex search buffer highlights."
|
||||
(when (evil-ex-hl-active-p 'evil-ex-search)
|
||||
|
@ -101,7 +101,7 @@ directives. By default, this only recognizes C directives.")
|
|||
;; --- evil hacks -------------------------
|
||||
(unless noninteractive
|
||||
(setq save-silently t)
|
||||
(add-hook 'after-save-hook
|
||||
(add-hook! 'after-save-hook
|
||||
(defun +evil-display-vimlike-save-message-h ()
|
||||
"Shorter, vim-esque save messages."
|
||||
(message "\"%s\" %dL, %dC written"
|
||||
|
@ -264,7 +264,7 @@ directives. By default, this only recognizes C directives.")
|
|||
(use-package! evil-exchange
|
||||
:commands evil-exchange
|
||||
:config
|
||||
(add-hook 'doom-escape-hook
|
||||
(add-hook! 'doom-escape-hook
|
||||
(defun +evil--escape-exchange-h ()
|
||||
(when evil-exchange--overlays
|
||||
(evil-exchange-cancel)
|
||||
|
|
|
@ -234,7 +234,7 @@ underlying, modified buffer. This fixes that."
|
|||
(when (bound-and-true-p org-capture-is-refiling)
|
||||
(org-save-all-org-buffers)))
|
||||
|
||||
(add-hook 'org-capture-mode-hook
|
||||
(add-hook! 'org-capture-mode-hook
|
||||
(defun +org-show-target-in-capture-header-h ()
|
||||
(setq header-line-format
|
||||
(format "%s%s%s"
|
||||
|
@ -408,7 +408,7 @@ file isn't in `org-directory'."
|
|||
(defvar +org-habit-graph-window-ratio 0.3
|
||||
"The ratio of the consistency graphs relative to the window width")
|
||||
|
||||
(add-hook 'org-agenda-mode-hook
|
||||
(add-hook! 'org-agenda-mode-hook
|
||||
(defun +org-habit-resize-graph-h ()
|
||||
"Right align and resize the consistency graphs based on
|
||||
`+org-habit-graph-window-ratio'"
|
||||
|
@ -439,7 +439,7 @@ file isn't in `org-directory'."
|
|||
;; Therefore, don't highlight when creating a sparse tree.
|
||||
(setq org-highlight-sparse-tree-matches nil)
|
||||
|
||||
(add-hook 'org-follow-link-hook
|
||||
(add-hook! 'org-follow-link-hook
|
||||
(defun +org-delayed-recenter-h ()
|
||||
"`recenter', but after a tiny delay. Necessary to prevent certain race
|
||||
conditions where a window's buffer hasn't changed at the time this hook is run."
|
||||
|
@ -461,7 +461,7 @@ eldoc string."
|
|||
nil 'face `(:foreground ,(face-foreground face nil t) :weight bold)))
|
||||
separator)))
|
||||
|
||||
(add-hook 'org-agenda-finalize-hook
|
||||
(add-hook! 'org-agenda-finalize-hook
|
||||
(defun +org-exclude-agenda-buffers-from-workspace-h ()
|
||||
"Prevent from temporarily-opened agenda buffers from being associated with
|
||||
the current workspace."
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
(setq ob-ipython-resources-dir ".ob-ipython-resrc")
|
||||
|
||||
(add-hook '+org-babel-load-functions
|
||||
(add-hook! '+org-babel-load-functions
|
||||
(defun +org-babel-load-ipython-h (lang)
|
||||
(and (string-prefix-p "jupyter-" (symbol-name lang))
|
||||
(require 'ob-ipython nil t))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue