2015-05-30 Some message-mode goodies

A few months ago I switched with my email to Emacs. My history of email started with pine, then briefly mutt, then claws-mail for a few years, and finally mu4e. Even if mu4e has a few rough edges, and its feature set isn’t even remotely comparable with things like Gnus, I am now very happy with my email setup. (Though I didn’t manage to get offlineimap to work, and I heard a horror story about offlineimap deleting someone’s mail, so I use mbsync, which works very well.)

Now it’s one thing to have a working email download-index-search-browse-send setup, and another to have a working email writing setup. Happily, mu4e reuses Emacs’ message-mode, which is surprisingly nice. If you happen to use mu4e (or any other Emacs mail client which uses message-mode), you might want to learn a few lesser-known tricks it has up its sleeve.

One I use quite often is C-c C-f t, or message-reduce-to-to-cc. It basically copies the contents of the Cc-field to the To-field. Very nice when answering emails on some mailing lists.

Another one, which I admittedly use very rarely, is C-c C-f s, or message-change-subject. It does exactly what is says on the tin: if you edit a message with subject foo, and press C-c C-f s, type bar and press RET, the subject is now bar (was: foo). Nice.

One I learned to use recently, and I use it all the time, is C-c M-m. The keybinding is rather strange, but the function (called message-mark-inserted-region), is extremely useful. Try to launch the message mode (C-x m will do it even in stock Emacs, without any mail client configured), type some text, mark a region, press C-c M-m and see for yourself. It has a companion called message-mark-insert-file, bound to C-c M-f.

Sometimes, however, I want to highlight something in a human language, like a quotation, or something. For that, I have installed the boxquote package. It’s available both on Melpa and on Marmalade, and it’s goal is to make things like this:

,----[ Sample quote ]
| This is a sample quote.  Notice that it looks good even if you
| send it to someone who reads mail in a proportional font (probably
| a non-hacker...).
`----

It has lots of commands to put various things in these “boxquotes”. (And did I mention that it works with filling?) I like (and use) it a lot. Try M-x apropos ^boxquote and see for yourself.

Finally, there is C-x TAB, or indent-rigidly. It works not only in message-mode, and indeed can be useful in other modes, too. Select the region, press C-u 4 C-x TAB, and have the region indented by 4 spaces. (And it works with negative indents, too.) Not something I would use every day, but potentially worth remembering.

CategoryEnglish, CategoryBlog, CategoryEmacs