diff --git a/.emacs.d/mail.el b/.emacs.d/mail.el index 47e6270..ca7ba8d 100644 --- a/.emacs.d/mail.el +++ b/.emacs.d/mail.el @@ -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 diff --git a/Mail.org b/Mail.org index 4f67fbf..5999e51 100644 --- a/Mail.org +++ b/Mail.org @@ -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: