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

David Edmondson dme at dme.org
Sun Apr 3 09:04:37 PDT 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 (or (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.

v3:
- Merge forward.
- Update the example to allow for a nil msg (which should no longer
  happen, but it's good to be safe).


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

 emacs/notmuch-lib.el  | 20 ++++++++++++++++----
 emacs/notmuch-show.el |  2 +-
 2 files changed, 17 insertions(+), 5 deletions(-)

-- 
2.1.4



More information about the notmuch mailing list