This command will try to view the message part the point is on with an
external viewer. The mime-type of the part will determine what viewer
will be used. Typically a 'text/html' part will be send to your
-browser.
+browser.
The configuration for this is kept in so called `mailcap`
files. (typically the file is `~/.mailcap` or `/etc/mailcap`) If the
## Multiple identities (and more) with message-templ
Another option for multiple identities is
-[message-templ](http://pivot.cs.unb.ca/git?p=message-templ.git;a=summary)
+[message-templ](http://git.tethera.net/message-templ.git)
(also a available in marmalade). This provides roughly the same
facilities as wanderlust's template facility.
See
-[example.emacs.el](http://pivot.cs.unb.ca/git?p=message-templ.git;a=blob;f=example.emacs.el;hb=HEAD)
+[example.emacs.el](https://git.tethera.net/message-templ.git/tree/example.emacs.el)
for some simple examples of usage.
## Resending (or bouncing) messages
(loop for p in load-path
do (if (file-accessible-directory-p p)
- (let ((m (directory-files-recursively p "^org-notmuch.el$")))
+ (let ((m (directory-files-recursively p "^ol-notmuch.el$")))
(if m (add-to-list 'load-path (file-name-directory (car m)))))))
Then
- (require 'org-notmuch)
+ (require 'ol-notmuch)
In general it is nice to have a key for org-links (not just for notmuch). For example
- (define-key global-map "\C-cl" 'org-store-link)
+ (define-key global-map "\C-c l" 'org-store-link)
+
+If you're using `use-package` the package can be loaded using the following:
+
+```emacs-lisp
+(use-package ol-notmuch
+ :ensure t
+ :bind
+ ("C-c l" . org-store-link))
+```
Note the package was renamed from `org-notmuch` to `ol-notmuch` in recent
-versions of org-mode, and you might want to `(require 'ol-notmuch)` instead.
+versions of org-mode. If you're using an old version of notmuch you might want
+to `(require 'org-notmuch)` instead.
## Viewing diffs in notmuch
The `notmuch-extract-thread-patches` and
`notmuch-extract-message-patches` commands from the `elpa-mailscripts`
package in Debian (and its derivatives) can do this for you.
+
+## 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.