From 66988068b79ca5677c4c7f4fed66a815a1b33d53 Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 8 Nov 2021 00:47:34 +0000 Subject: gnus + nnml + notmuch --- email.org | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'email.org') 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 -- cgit v1.2.3