1 [[!img notmuch-logo.png alt="Notmuch logo" class="left"]]
2 #Tips and Tricks for using notmuch with Emacs
6 Any notmuch reply will automatically include your primary email
7 address in a BCC so that any messages you send will (eventually) end
8 up in your mail store as well.
10 But this doesn't do anything for messages that you compose that are
11 not replies. So we need to get sane message-mode FCC figured
12 out. Some investigation is still needed here.
14 * How to customize notmuch-folders
16 There's a "notmuch-folder" command available in the emacs client
17 that displays a list of "folders" and the number of messages in
18 each. Each folder is simply a named search specification. To
19 configure this mode, edit your ${HOME}/.emacs file and include text
20 something like the following:
22 (setq notmuch-folders '(("inbox" . "tag:inbox")
23 ("unread" . "tag:inbox AND tag:unread")
24 ("notmuch" . "tag:inbox AND to:notmuchmail.org")))
26 Of course, you can have any number of folders, each configured
27 with any supported search terms (see "notmuch help search-terms").
29 * Viewing HTML messages with an external viewer
31 The emacs client can often display an HTML message inline, but it
32 sometimes fails for one reason or another, (or is perhaps inadequate
33 if you really need to see the graphical presentation of the HTML
36 In this case, it can be useful to display the message in an external
37 viewer, such as a web browser. Here's a little script that Keith
38 Packard wrote, which he calls view-html:
44 if munpack -C "$dir" -t < "$dir"/msg 2>&1 | grep 'Did not find'; then
45 sed -n '/[Hh][Tt][Mm][Ll]/,$p' "$dir"/msg > $dir/part1.html
48 for i in "$dir"/part*; do
49 if grep -q -i -e '<html>' -e 'text/html' "$i"; then
56 Save that script somewhere in your ${PATH}, make it executable, and
57 change the invocation of iceweasel to any other HTML viewer if
58 necessary. Then within the emacs client, press "|" to pipe the
59 current message, then type "view-html".
61 Keith mentions the following caveat, "Note that if iceweasel isn't
62 already running, it seems to shut down when the script exits. I