summaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-05-21 12:55:19 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-05-21 17:03:21 -0700
commitaa6f3777d93b85a169b6ec944167e7002b8c758c (patch)
tree094fb8c930580ebf7194e6e9f83d2e39c66d1688 /.emacs.d
parent90ca984cfecf642102282b1c61de5182d997d965 (diff)
downloaddotfiles-aa6f3777d93b85a169b6ec944167e7002b8c758c.tar.gz
avoid adding (require 'notmuch) advice over and over again
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/init.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 03d9e220..7716bd8f 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -2658,9 +2658,10 @@ to open them using `spw/try-external-open'")
(spw/when-library-available notmuch
;; Ensure `notmuch-user-agent' is loaded, `notmuch-saved-searches' is
;; populated etc. when I invoke certain commands soon after starting Emacs.
+ (defun spw/require-notmuch (&rest ignore) (require 'notmuch))
(dolist (cmd '(compose-mail notmuch-jump-search notmuch-hello
compose-mail-other-window compose-mail-other-frame))
- (advice-add cmd :before (lambda (&rest ignore) (require 'notmuch)))))
+ (advice-add cmd :before #'spw/require-notmuch)))
;; An alternative would be just to bind `notmuch-hello' to C-c m, as s, j
;; and <f9> have appropriate bindings in `notmuch-hello-mode' such that the