Emacs Gnus: Specify Which Mail Folders to See at All Times
The ultimate way to read, send and manage email (and RSS feeds, and Usenet) is with Emacs Gnus. Here are two ways to instruct Gnus to always show a select few mail folders.
At the 2025 Emacs Conf, which took place on 6 and 7 December, Amin Bandali gave a 20 minutes introduction on how to get started with Gnus.
Amin on his blog shared the sample Gnus config file that he uses for the demo. He suggests to use the following code to make the Gnus Group buffer to always show all mail folders:
;; Always show INBOX groups even if they have no unread or ticked
;; messages.
(setopt gnus-permanently-visible-groups ":INBOX$")This option uses a regexp to match all mail folders , and make them visible. [I was mistaken about this. See the "update", below]
I did not know or had forgotten about this setting, and seeing it in the demo made me check which settings I use.
Focus
Out of the box, the Gnus Group will always show the mail folders that have new (unread) mail. If you have several tens or even a few hundred of mail folders, seeing only those that have new messages, helps to focus.
If you have a lot of mail folders you will, firstly, want to use gnus-topic-mode to help sort them. Enter "t" in the Group buffer.
Secondly, it might then be helpful to show in your Group buffer - at all times - a few important mail folders. You see them even if there is no new mail in them. For example, the overall INBOX, and the email folder for mail from the boss (INBOX.boss) or INBOX.home.
Here is how. You can select the ones you always want to see, by using Gnus' "Topic Parameters"
gnus-topic-edit-parameters
You get there by entering "G p" on a mailbox in the Group buffer. and write:
(visible . t)List all groups
If needed, I can use "L" (gnus-group-list-all-groups) to show me the entire list, and "l" (gnus-group-list-groups) to toggle it back to the minimal list.
Update
Via email, Amin pointed out that his regexp is for all mail folder ending in INBOX. Woops, of course. And there should be just one of those.
He also explained his motivation: to manage it from within the Gnus configuration file.
TIL: we can use the same ‘gnus-permanently-visible-groups’ to list several mailboxes. It requires a different regexp:
(setopt gnus-permanently-visible-groups "INBOX.boss\\|INBOX.home\\|INBOX$")