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?
Changing the display name of a GNUS group
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.
© 2022 - 2024 — McMap. All rights reserved.
(banner . REGEXP)
group parameter will strip any matches toREGEXP
from an article... – Frymire(variable form)
found on this page lists ways of removing tags and such... – Frymiregnus-group-line-format
variable? Note this page, especially theNAMESPACE
section where the "user format function" is discussed. – Frymire%uG
technique described there. – Beekeeper