fix(mail): better workaround for Guix profile

This commit is contained in:
Pavel Korytov 2021-07-12 10:10:38 +03:00
parent 21d8917821
commit 00141e7dca
2 changed files with 6 additions and 32 deletions

View file

@ -1,20 +1,7 @@
(setq my/notmuch-loaded nil)
(let ((default-directory "/home/pavel/.guix-extra-profiles/mail/mail/share/emacs/site-lisp"))
(normal-top-level-add-subdirs-to-load-path))
(defun my/run-notmuch ()
(interactive)
(when (not my/notmuch-loaded)
(let* ((notmuch-dir (shell-command-to-string "readlink -f $(which notmuch)"))
(notmuch-version (substring (shell-command-to-string "notmuch --version") 8 -1))
(notmuch-lisp-dir (concat
(substring notmuch-dir 0 -13)
"/share/emacs/site-lisp/notmuch-"
notmuch-version
"/")))
(push notmuch-lisp-dir load-path))
(setq my/notmuch-loaded t))
(notmuch))
(my-leader-def "am" 'my/run-notmuch)
(my-leader-def "am" 'notmuch)
(use-package notmuch
;; :ensure nil

View file

@ -174,23 +174,10 @@ Finally, Emacs configuration.
The problem with my Guix setup is that Emacs by default doesn't see the elisp files of notmuch, so here is a small workaround:
#+begin_src emacs-lisp
(setq my/notmuch-loaded nil)
(let ((default-directory "/home/pavel/.guix-extra-profiles/mail/mail/share/emacs/site-lisp"))
(normal-top-level-add-subdirs-to-load-path))
(defun my/run-notmuch ()
(interactive)
(when (not my/notmuch-loaded)
(let* ((notmuch-dir (shell-command-to-string "readlink -f $(which notmuch)"))
(notmuch-version (substring (shell-command-to-string "notmuch --version") 8 -1))
(notmuch-lisp-dir (concat
(substring notmuch-dir 0 -13)
"/share/emacs/site-lisp/notmuch-"
notmuch-version
"/")))
(push notmuch-lisp-dir load-path))
(setq my/notmuch-loaded t))
(notmuch))
(my-leader-def "am" 'my/run-notmuch)
(my-leader-def "am" 'notmuch)
#+end_src
And the proper notmuch settings: