summaryrefslogtreecommitdiffhomepage
path: root/email.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-11-08 00:47:34 +0000
committerjao <jao@gnu.org>2021-11-08 00:48:11 +0000
commit66988068b79ca5677c4c7f4fed66a815a1b33d53 (patch)
tree2ef25a295f7cebf5f21bf82167b30510321e1d26 /email.org
parent766c3a3b66f7af3f1d32306b8c494d2a6abe5662 (diff)
downloadelibs-66988068b79ca5677c4c7f4fed66a815a1b33d53.tar.gz
elibs-66988068b79ca5677c4c7f4fed66a815a1b33d53.tar.bz2
gnus + nnml + notmuch
Diffstat (limited to 'email.org')
-rw-r--r--email.org36
1 files changed, 34 insertions, 2 deletions
diff --git a/email.org b/email.org
index a9bc09c..8dec9ac 100644
--- a/email.org
+++ b/email.org
@@ -1,5 +1,5 @@
#+property: header-args:emacs-lisp :lexical t :tangle yes :comments yes :results silent :shebang ";; -*- lexical-binding: t; -*-" :tangle-mode (identity #o644)
-#+title: email handling (message mode, bbdb, notmuch)
+#+title: email handling (message mode, bbdb, gnus, notmuch)
#+auto_tangle: t
* message mode
@@ -209,7 +209,6 @@
#+end_src
* multipart html renderer
#+begin_src emacs-lisp
-
(defun jao-w3m-html-renderer (handle)
(let ((w3m-message-silent t)
(mm-w3m-safe-url-regexp nil))
@@ -220,7 +219,14 @@
(shr-use-colors nil))
(mm-shr handle))))))
+ (defun jao-shr-html-renderer (handle)
+ (let ((shr-use-fonts nil)
+ (shr-use-colors nil)
+ (fill-column 120))
+ (mm-shr handle)))
+
;; (setq mm-text-html-renderer #'jao-w3m-html-renderer)
+ (setq mm-text-html-renderer #'jao-shr-html-renderer)
#+end_src
* bbdb
#+begin_src emacs-lisp
@@ -346,3 +352,29 @@
(when (eq jao-afio-mail-function 'notmuch)
(jao-load-org "notmuch"))
#+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* ((root "~/var/mail/")
+ (folder (if folder
+ (file-name-as-directory folder)
+ (completing-read "Folder: "
+ 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