From c34b2c10d0d2155f2c58b754d65c14f014d715ee Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Fri, 20 May 2022 17:23:01 -0400 Subject: [PATCH] Filter out stale email addresses --- global.org | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/global.org b/global.org index e81bbc3..76d9ecb 100644 --- a/global.org +++ b/global.org @@ -725,6 +725,22 @@ (mu4e-icalendar-setup) #+end_src + This snippet filters stale addresses from address completion; I + found this method [[https://emacs.stackexchange.com/questions/47789/how-to-remove-email-address-from-local-database-in-mu4e][here]]. The code loads the definition of + ~filter-addresses~ from an external file and checks if ~addr~ is + one of the addresses in the list. + + #+begin_src emacs-lisp + (load-file "filtered-emails.el") + + (defun my-mu4e-contact-filter-function (addr) + (let ((ignore nil)) + (if (dolist (address filter-addresses ignore) + (setq ignore (or ignore (string-equal addr address)))) + nil addr))) + + (setq mu4e-contact-process-function 'my-mu4e-contact-filter-function) + #+end_src ** org-mode *** Require Require the ~org~ package; I also occasionally use org-pomodoro