summaryrefslogtreecommitdiffhomepage
path: root/email.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-16 02:12:12 +0100
committerjao <jao@gnu.org>2021-05-16 02:12:12 +0100
commitcf81ccc6e7a4cb50151d1b2f7a81369ef516a0db (patch)
tree8ea7b9c6ccfcb250d5697d0dca1ccccbf3bffba5 /email.org
parentdebec7e4a401b0ae2d12923264db8adfa577f3c2 (diff)
downloadelibs-cf81ccc6e7a4cb50151d1b2f7a81369ef516a0db.tar.gz
elibs-cf81ccc6e7a4cb50151d1b2f7a81369ef516a0db.tar.bz2
fix for init loading
Diffstat (limited to 'email.org')
-rw-r--r--email.org34
1 files changed, 34 insertions, 0 deletions
diff --git a/email.org b/email.org
index 745fb07..64b4e7c 100644
--- a/email.org
+++ b/email.org
@@ -247,6 +247,13 @@
(setq bbdb-file (expand-file-name "~/.emacs.d/bbdb"))
(bbdb-initialize 'message 'pgp 'mail)
#+end_src
+* mailboxes
+ #+begin_src emacs-lisp
+ (defun jao-list-mailboxes (base)
+ (let ((dir (expand-file-name base "~/var/mail")))
+ (seq-difference (directory-files dir)
+ '("." ".." "sent" "inbox" "trash"))))
+ #+end_src
* gnus
*** Directories
#+begin_src emacs-lisp
@@ -322,6 +329,33 @@
,(jao-notmuch--q "new" nil "n" '("tag:new"))
,(jao-notmuch--q "draft" nil "d" '("tag:draft"))))
#+end_src
+*** consult
+ #+begin_src emacs-lisp
+ (use-package consult-notmuch
+ :ensure t
+ :init (setq consult-notmuch-authors-width 30)
+ :config
+ (add-to-list 'consult-config '(consult-notmuch :preview-key any))
+ (add-to-list 'consult-buffer-sources 'consult-notmuch-buffer-source))
+
+ (defvar jao-consult-notmuch-folders
+ (seq-mapcat (lambda (base)
+ (mapcar `(lambda (d) (format "%s/%s" ,base d))
+ (jao-list-mailboxes base)))
+ '("jao" "bigml" "feeds" "trove")))
+
+ (defun jao-consult-notmuch-folder (&optional tree folder)
+ (interactive "P")
+ (let* ((root "~/var/mail/")
+ (folder (if folder
+ (file-name-as-directory folder)
+ (completing-read "Folder: "
+ jao-consult-notmuch-folders)))
+ (folder (replace-regexp-in-string "/\\(.\\)" ".\\1" folder))
+ (init (read-string "Initial query: "))
+ (init (format "folder:/%s/ %s" folder init)))
+ (if tree (consult-notmuch-tree init) (consult-notmuch init))))
+ #+end_src
*** org mode integration
Stolen and adapted from [[https://gist.github.com/fedxa/fac592424473f1b70ea489cc64e08911][Fedor Bezrukov]].
#+begin_src emacs-lisp