Is there any way to change the name displayed for a group in GNUS without actually renaming the group? I read my email off of an IMAP server, and the group names are pretty ugly (e.g. nnimap+uwindsor:INBOX.) I tried using the command gnus-group-rename-group
but that attempts to change the name on the actual server. Is there any way to simply map the actual name to some local display name, to make my group buffer a little bit more readable?
So here's how I solved the problem. First off, many thanks to abiessu for pointing me in the right direction through 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 simply looks up the current group name in a map I define, and if there is a "translation" it displays that instead of the actual name. Some examples that I'm using in my config are:
(setq group-name-map '(("nnimap+uwindsor:INBOX" . "School-Inbox")
("nnimap+uwindsor:[Gmail]/Starred" . "School-Starred")
("nnimap+uwindsor:[Gmail]/Sent Mail" . "School-Sent")))
Using just an alist is nice because I can create the mappings anyway I want to, without having to resort to regexes, patterns, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With