summaryrefslogtreecommitdiffhomepage
path: root/notmuch.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-12-13 03:14:33 +0000
committerjao <jao@gnu.org>2021-12-13 03:14:33 +0000
commit5197bdaa4a89b38f7a3813d870458476c3968e5c (patch)
tree9365e4ec90ce56db0e10445809a030d094ebb883 /notmuch.org
parent79a4f5313188476eb3ff601d85e6b1c24460be35 (diff)
downloadelibs-5197bdaa4a89b38f7a3813d870458476c3968e5c.tar.gz
elibs-5197bdaa4a89b38f7a3813d870458476c3968e5c.tar.bz2
reshufflings
Diffstat (limited to 'notmuch.org')
-rw-r--r--notmuch.org25
1 files changed, 25 insertions, 0 deletions
diff --git a/notmuch.org b/notmuch.org
index 9094c32..81b2270 100644
--- a/notmuch.org
+++ b/notmuch.org
@@ -504,3 +504,28 @@
(org-capture nil "X"))))
#+end_src
+* consult
+ #+begin_src emacs-lisp
+ (jao-load-path "consult-notmuch")
+ (require 'consult-notmuch)
+ (consult-customize consult-notmuch :preview-key 'any)
+
+ (defvar jao-consult-notmuch-history nil)
+
+ (defun jao-consult-notmuch-folder (&optional tree folder)
+ (interactive "P")
+ (let ((folder (if folder
+ (file-name-as-directory folder)
+ (completing-read "Group: "
+ jao-mailbox-folders
+ nil nil nil
+ jao-consult-notmuch-history
+ ".")))
+ (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))))
+
+ (with-eval-after-load "notmuch-hello"
+ (define-key notmuch-hello-mode-map "f" #'jao-consult-notmuch-folder))
+ #+end_src