summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--completion.org27
-rw-r--r--email.org34
-rw-r--r--init.org5
3 files changed, 34 insertions, 32 deletions
diff --git a/completion.org b/completion.org
index 29b85a3..b00b8cd 100644
--- a/completion.org
+++ b/completion.org
@@ -118,33 +118,6 @@
(define-key consult-narrow-map (vconcat consult-narrow-key "?")
#'consult-narrow-help))
#+end_src
-*** notmuch
- #+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
*** recoll
#+begin_src emacs-lisp
(jao-load-path "consult-recoll")
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
diff --git a/init.org b/init.org
index e0e8438..d04e46c 100644
--- a/init.org
+++ b/init.org
@@ -1578,11 +1578,6 @@
(if (fboundp 'w3m-view-mode) (w3m-view-source) (View-quit))
(when url (cons url (or title ""))))))))
- (defun jao-list-mailboxes (base)
- (let ((dir (expand-file-name base "~/var/mail")))
- (seq-difference (directory-files dir)
- '("." ".." "sent" "inbox" "trash"))))
-
(defun jao-rss-subscribe ()
(interactive)
(let* ((url (or (jao-url-around-point)