Jumping to the inbox in GNUS

I’ve used GNUS to read my mail for a long time now.  Every once in a while I try to move to something else because of simplicity or ease of use, but I always come back.  The unparalleled ability to customize and script the environment is just really hard to beat.

The “resting state” in GNUS is the group buffer, which shows you (by default) only groups that have unread messages in them.  I like this a lot as it provides a sort of dashboard to the mail items that need attention.  However, if I need to recall an already-read message, I have to hit L to show all groups, and then search (because I have a lot) for the appropriate group and then enter it to find the message.  This isn’t a huge hassle, but sometimes I get annoyed at the process.

Since 90% of the time, I’m recalling messages from my inbox, I decided to write a function that would make this common case quicker.  I came up with the following bit of elisp:

(defun dan/select-inbox ()
  “Select inbox”
  (interactive)
  (save-excursion
    (gnus-group-list-all-groups)
    (if (search-forward-regexp “mail.*misc” (point-max) t)
    (gnus-group-select-group))))

Assuming I’m in the group buffer, I can run this function and it asks me right away how many messages I want to view from my inbox.  Naturally, I want a quick key sequence to trigger this function, so I chose the unused “G i”keys for “Group…Inbox”.  I bound it thusly:

 (define-key gnus-group-group-map “i” ‘dan/select-inbox)

Now from inside the group buffer, I can hit “G i”, type “10” (or so) and quickly recall recent messages.

 

Category(s): Codemonkeying

Comments are closed.