+
+## Allow content preference based on message context
+
+The preference for which sub-part of a multipart/alternative part is shown is
+globally set. For example, if you prefer showing the html version over the text
+based, you can set:
+
+ (setq notmuch-multipart/alternative-discouraged '("text/plain" "text/html"))
+
+However, sometimes you might want to adapt your preference depending on the
+context. You can override the default settings on a per-message basis by
+providing a function that has access to the message and which returns the
+discouraged type list. For example:
+
+ (defun my/determine-discouraged (msg)
+ (let* ((headers (plist-get msg :headers))
+ (from (or (plist-get headers :From) "")))
+ (cond
+ ((string-match "whatever@mail.address.com" from)
+ '("text/plain"))
+ (t
+ '("text/html" "multipart/related")))))
+
+ (setq notmuch-multipart/alternative-discouraged
+ 'my/determine-discouraged)
+
+This would discourage text/html and multipart/related generally, but discourage
+text/plain should the message be sent from whatever@mail.address.com.
+
+## See the recipient address instead of your address when listing sent messages
+
+If you like to see your sent messages in unthreaded view, by default you will
+see your address in the authors column, which is maybe not what you want. The
+following code allows for showing the recipients if your email address (an
+arbitrary address, whatever@mail.address.com in the example) is included in the
+From field.
+
+ (defun my/notmuch-unthreaded-show-recipient-if-sent (format-string result)
+ (let* ((headers (plist-get result :headers))
+ (to (plist-get headers :To))
+ (author (plist-get headers :From))
+ (face (if (plist-get result :match)
+ 'notmuch-tree-match-author-face
+ 'notmuch-tree-no-match-author-face)))
+ (propertize
+ (format format-string
+ (if (string-match "whatever@mail.address.com" author)
+ (concat "↦ " (notmuch-tree-clean-address to))
+ (notmuch-tree-clean-address to)
+ author))
+ 'face face)))
+
+ (setq notmuch-unthreaded-result-format
+ '(("date" . "%12s ")
+ (my/notmuch-unthreaded-show-recipient-if-sent . "%-20.20s")
+ ((("subject" . "%s"))
+ . " %-54s ")
+ ("tags" . "(%s)")))
+
+## Issues with Emacs 24 (unsupported since notmuch 0.31 (2020-09-05))
+
+If notmuch-show-mode behaves badly for you in emacs 24.x try adding one of
+
+ (setq gnus-inhibit-images nil)
+
+or
+
+ (require 'gnus-art)
+
+to your .emacs file.