[PATCH v2] Allow content preference based on message content.

David Edmondson dme at dme.org
Fri Jan 29 09:27:00 PST 2016


Allow content preference based on message content.

An example configuration might be:

  (defun dme:determine-discouraged (msg)
    (let* ((headers (plist-get msg :headers))
	   (from (plist-get headers :From)))
      (cond
       ((string-match "9195404 at capita-intouch.co.uk" from)
	'("text/plain"))
       (t
	'("text/html" "multipart/related")))))

   (setq notmuch-multipart/alternative-discouraged
   	 'dme:determine-discouraged)

This would discourage text/html and multipart/related generally, but
discourage text/plain should the message be sent from
9195404 at capita-intouch.co.uk.

v2:
- Remove the simple evaluation variant based on feedback.


David Edmondson (1):
  emacs: Allow part preferences to depend on message content.

 emacs/notmuch-lib.el  | 20 ++++++++++++++++----
 emacs/notmuch-mua.el  |  2 +-
 emacs/notmuch-show.el |  2 +-
 3 files changed, 18 insertions(+), 6 deletions(-)

-- 
2.6.3



More information about the notmuch mailing list