diff options
author | jao <jao@gnu.org> | 2021-06-12 22:37:25 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-06-12 22:37:47 +0100 |
commit | 5e8c95e1b79e78c6dc4d9df61e12fdc318a8f65e (patch) | |
tree | ce2b75ac9ea1e13e3fd288db6178cf6213ae1370 | |
parent | 7da7f5f627b9ba657f3fb08c8eacf2de9300d770 (diff) | |
download | elibs-5e8c95e1b79e78c6dc4d9df61e12fdc318a8f65e.tar.gz elibs-5e8c95e1b79e78c6dc4d9df61e12fdc318a8f65e.tar.bz2 |
notmuch: better address cleansing
-rw-r--r-- | email.org | 57 |
1 files changed, 23 insertions, 34 deletions
@@ -1,5 +1,4 @@ #+property: header-args:emacs-lisp :lexical t :tangle yes :comments yes :results silent :shebang ";; -*- lexical-binding: t; -*-" -#+property: header-args:bash :comments yes :shebang "#!/bin/bash" :tangle-mode (identity #o755) #+title: email handling (message mode, bbdb, notmuch) #+auto_tangle: t @@ -433,7 +432,25 @@ :config (when (eq 'notmuch jao-afio-mail-function) - (setq mm-text-html-renderer 'shr)) + (setq mm-text-html-renderer 'shr + message-directory "~/var/mail/" + message-auto-save-directory "/tmp") + (with-eval-after-load "notmuch-message" + (define-key message-mode-map (kbd "C-c C-d") + #'notmuch-draft-postpone))) + + (defun jao-mail-clean-address (fun address) + (let ((address + (if (string-match ".+ updates on arXiv.org: \\(.+\\)" address) + (with-temp-buffer + (insert (match-string 1 address)) + (let ((shr-width 1000)) + (shr-render-region (point-min) (point-max))) + (buffer-string)) + (string-replace "ElDiario.es - ElDiario.es" "D.es" address)))) + (funcall fun address))) + + (advice-add 'notmuch-clean-address :around #'jao-mail-clean-address) (defun jao-notmuch-refresh-agenda () (interactive) @@ -520,7 +537,7 @@ ("RET" . jao-notmuch-tree-show-or-scroll) ("SPC" . jao-notmuch-tree-scroll-or-next)) :map notmuch-show-mode-map - (("h" . jao-notmuch-goto-index-buffer)) + (("h" . jao-notmuch-goto-tree-buffer)) :map notmuch-common-keymap (("B" . jao-notmuch-browse-urls)))) #+end_src @@ -558,40 +575,12 @@ ("f" notmuch-tree-forward-message "forward") ("e" notmuch-tree-resume-message "edit draft")))) #+end_src -*** address clean-ups - #+begin_src emacs-lisp - (defun jao-mail-clean-address (fun address) - (let ((address (if (string-match ".+ updates on arXiv.org: \\(.+\\)" - address) - (with-temp-buffer - (insert (match-string 1 address)) - (let ((shr-width 1000)) - (shr-render-region (point-min) (point-max))) - (buffer-string)) - (replace-regexp-in-string "^ElDiario.es - ElDiario.es" - "ElDiario.es" - address)))) - (funcall fun address))) - - (with-eval-after-load "notmuch" - (advice-add 'notmuch-clean-address :around #'jao-mail-clean-address)) - #+end_src -*** mua - #+begin_src emacs-lisp - (when (eq jao-afio-mail-function 'notmuch) - (setq message-directory "~/var/mail/" - message-auto-save-directory "/tmp") - (with-eval-after-load "notmuch-message" - (define-key message-mode-map (kbd "C-c C-d") - #'notmuch-draft-postpone))) - #+end_src *** consult #+begin_src emacs-lisp (jao-load-path "consult-notmuch") - - (use-package consult-notmuch - :init (setq consult-notmuch-authors-width 30) - :config (consult-customize consult-notmuch :preview-key 'any)) + (setq consult-notmuch-authors-width 30) + (require 'consult-notmuch) + (consult-customize consult-notmuch :preview-key 'any) (defvar jao-consult-notmuch-history nil) |