Changing the display name of a GNUS group

Is it possible to change the name displayed for a group in GNUS without actually renaming the group? I read my email from the IMAP server, and the group names are pretty ugly (like nnimap + uwindsor: INBOX.) I tried using the gnus-group-rename-group command, but tried to change the name on the server itself. Is there a way to simply map the actual name to some local display name to make my group buffer a little more readable?

+7
emacs imap gnus
source share
1 answer

So, here is how I solved the problem. Firstly, many thanks to abiessu for pointing me in the right direction with his comments.

 (setq gnus-group-line-format "%M%S%5y/%-5t: %uG %D\n") (defun gnus-user-format-function-G (arg) (let ((mapped-name (assoc gnus-tmp-group group-name-map))) (if (null mapped-name) gnus-tmp-group (cdr mapped-name)))) 

This little function just searches for the current group name on the map that I define, and if there is a “translation”, it displays it instead of the actual name. Some examples that I use in my configuration:

 (setq group-name-map '(("nnimap+uwindsor:INBOX" . "School-Inbox") ("nnimap+uwindsor:[Gmail]/Starred" . "School-Starred") ("nnimap+uwindsor:[Gmail]/Sent Mail" . "School-Sent"))) 

Using only an alista is good, because I can create mappings anyway, I don't want to resort to regular expressions, patterns, etc.

+6
source share

All Articles