[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can I choose names for nnmaildir groups?
From: |
Richard Riley |
Subject: |
Re: Can I choose names for nnmaildir groups? |
Date: |
Wed, 08 Dec 2010 15:46:50 -0000 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) |
Richard Riley <rileyrg@googlemail.com> writes:
> Sean McAfee <eefacm@gmail.com> writes:
>
>> I use nnmaildir as my primary backend:
>>
>> (setq gnus-secondary-select-methods
>> '((nnmaildir "mail" (directory "/home/smcafee/.nnmaildir"))))
>>
>> Within that directory, procmail divides my incoming mail into various
>> subdirectories. In Gnus's group view, the groups representing those
>> subdirectories all have a common, longish prefix "nnmaildir+mail:".
>> That's a little cluttered, and I'd prefer to be able to name them
>> eg. "mail.list-1", "mail.list-2", etc.
>>
>> Is this possible? Extensive Googling and experimenting haven't turned
>> up any working solutions.
>
> Hi Sean,
>
> You need to modify gnus-group-line-format. My format line is
>
> "%M%S%p%P%-12uy%(%-60ug%)\n"
>
> I'm pretty sure that the "g" is what you want. That said %c looks
> promising too ...
>
> regards
>
> r.
I new as I hit send I was being a little "hasty" ...
%c might do something, but now I just remembered I put in user defined
format functions (the %ug being one) in order to propertize my format to
use different faces depending on whether there were new articles or not.
Maybe something in this hack I use can help you if %c doesnt do the job.
,----
| (defun gnus-user-format-function-g (headers) ;; gnus-group-line-format use
%ug to call this func! e.g "%M%S%p%P%(%-40,40ug%)%-5uy %ud\n"
| ;; split full group protocol-server:group into three parts.
| (string-match "\\(^.*\\)\\+\\(.*\\):\\(.*\\)" gnus-tmp-group)
| ;; map the first two letters of the server name to a more friendly and
cuddly display name
| (let* ((match-ok (match-string 2 gnus-tmp-group))
| (server-key (if (null match-ok) nil (upcase(substring match-ok 0
2)))))
| (if (zerop (length server-key))
| gnus-tmp-group
| ;; construct new group format line with a small envelope taking the
place of any INBOX
| (concat
| (propertize
| (format "%-8s" (cdr (assoc server-key rgr/server-name-maps)))
| 'face (rgr/unread-face "my-group-server-face") 'face
(rgr/unread-face (concat "my-group-server-face-" server-key)) 'gnus-face t)
| " - "
| (if (string-match "INBOX" (match-string 3 gnus-tmp-group) )
| (propertize "\x2709" 'face (rgr/unread-face
"my-inbox-icon-face") 'gnus-face t)
| (propertize (match-string 3 gnus-tmp-group) 'face (rgr/unread-face
"my-group-face") 'gnus-face t) )))))
`----
r.