2009-08-16 Rediscovering .mailrc

My old laptop will only run Firefox 2 and I’m too lazy to attempt and build a new binary. That means its Javascript implementation is very slow, and that means that Gmail is getting too slow to use. I started to use Gnus again. Yesterday I discovered how aggravating it is to send a new mail instead of replying to one. You have to actually know email addresses! Gaaah!

Gnus

Via help on the TAB key I discovered that the function in question is `message-expand-name`, which in turn run `expand-abbrev`. And via the Mail Aliases section in the Message manual I learnt about `mailabbrev`, the package that parses the `~/.mailrc` file and creates all the abbreviations. Once I started looking for it I discovered that I actually already had a `~/.mailrc` file – I must have created it ages ago. The first thing I did was delete all entries except for family and close friends. πŸ˜„

Now, I define an alias as follows:

alias Alex "Alex Schroeder <kensanata@gmail.com>"

When I type β€œalex” TAB in a header field of a new mail, this gets expanded. Remember to use `message-mode`, not `mail-mode`! But what if I type β€œal” TAB and want to be told about the existing β€œalex” alias?

;; override the simple defun provided
(defadvice message-expand-name (after or-complete-alias activate)
  "Complete alias at point if it could not be expanded."
  (unless ad-return-value
    (mail-abbrev-complete-alias)))

So now I type β€œal” TAB and see the list of aliases that start with β€œal”, or this gets completed to the only matching alias, β€œalex”, and when I press TAB again, that is expanded into the real email address.

If only I knew how to make this a cycling expansion... πŸ˜„

​#Emacs ​#Gnus

Comments

(Please contact me if you want to remove your comment.)

⁂

You can also use BBDB with Gnus, which provides email address expansion as well. I have this in my `~/.emacs.el`:

BBDB

(require 'bbdb)
(bbdb-initialize 'gnus 'message 'w3)
(add-hook 'message-setup-hook 'bbdb-define-all-aliases)

– Andreas Rottmann 2009-08-26 13:13 UTC

Andreas Rottmann

---

Yes, many ages ago I was in fact one of the BBDB developpers. As I’m slowly creeping back into Gnus territory, I dread to dive into it head-first... πŸ˜„

– Alex Schroeder 2009-08-26 15:50 UTC

Alex Schroeder