diff options
| author | Thomas Schneider <qsx@chaotikum.eu> | 2021-05-05 22:31:25 +0200 |
|---|---|---|
| committer | Thomas Schneider <qsx@chaotikum.eu> | 2021-05-05 22:31:25 +0200 |
| commit | b70cd547a7a41f29e83b6e49bfbeaebf4cb9a452 (patch) | |
| tree | 2a0c366dad8ecf4d46bfa34a8c6cb94966c32dde | |
| parent | b5b88e84f051aa0b2329a229c98d2e2d7a748ab8 (diff) | |
Emacs: Configure Gnus maildir dynamically
| -rw-r--r-- | dot.emacs.d/init.el | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/dot.emacs.d/init.el b/dot.emacs.d/init.el index 102bbe0..c758232 100644 --- a/dot.emacs.d/init.el +++ b/dot.emacs.d/init.el @@ -297,11 +297,22 @@ gnus-select-method '(nntp "news.cis.dfn.de" (nntp-open-connection-function nntp-open-ssl-stream) (nntp-port-number 563)) - gnus-secondary-select-methods '((nnmaildir "mail" - (directory "~/.maildir") - (nnir-search-engine notmuch))) - ;; nnir-notmuch-program "/home/qsx/.local/bin/notmuch-gnus" - nnir-notmuch-remove-prefix (concat (getenv "HOME") "/.maildir/")) + nnir-notmuch-program (let ((notmuch-gnus "/home/qsx/.local/bin/notmuch-gnus")) + (if (file-executable-p notmuch-gnus) + notmuch-gnus + "notmuch"))) + (let ((maildir (cl-find-if #'file-directory-p + (mapcar (lambda (x) (concat (getenv "HOME") x)) + '("/.nnmaildir" + "/.maildir" + "/Maildir"))))) + (setq + gnus-secondary-select-methods `((nnmaildir + "mail" + (directory ,maildir) + (nnir-search-engine notmuch))) + nnir-notmuch-remove-prefix (concat maildir "/"))) + (add-hook 'message-setup-hook (defun qsx-message-add-my-headers () (message-add-header "Openpgp: id=E384009D3B54DCD321BF953295EE94A432583DB1; url=https://pgp.mit.edu/pks/lookup?op=get&search=0x95EE94A432583DB1; preference=signencrypt")))) |
