* displaying unseen/unread in *Group*
@ 2003-01-12 23:45 Sean Neakums
2003-01-13 18:21 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Sean Neakums @ 2003-01-12 23:45 UTC (permalink / raw)
I just slapped together the following group format specifier function
function to display "0" when a group has no unread messages, "X" when
it has 0 unseen and X unread, and "X/Y" when it has X unseen and Y
unread. It may save somebody else five minutes or so of their life,
so here it is.
There doesn't seem to be a way in the format specifier syntax to slam
two or more fields together in an aligned column, which is why I did
it this way. Doing %5U/%5y gives " 12/ 234", for example. Replace
%5y by %11uX in gnus-group-line-format to use the function.
Example display:
[ Gnus -- 15 ]
0: inbox
2: debian-hurd
1/1: linux-scsi
1/12: linux-xfs
0: sent
I'm not so happy about using the gnus-tmp-* symbols (their names make
me think I shouldn't rely on them at all), but it seemed to be the
most direct way to do it.
(defun gnus-user-format-function-X (group)
"Return \"unseen/unread\". For use in the group specifier."
(let ((unread gnus-tmp-number-of-unread)
(unseen (int-to-string (gnus-number-of-unseen-articles-in-group gnus-tmp-group))))
(if (not (or (string-equal unseen "0")))
(concat unseen "/" unread)
unread)))
--
/ |
[|] Sean Neakums | Questions are a burden to others;
[|] <sneakums@zork.net> | answers a prison for oneself.
\ |
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: displaying unseen/unread in *Group*
2003-01-12 23:45 displaying unseen/unread in *Group* Sean Neakums
@ 2003-01-13 18:21 ` Lars Magne Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-13 18:21 UTC (permalink / raw)
Sean Neakums <sneakums@zork.net> writes:
> I'm not so happy about using the gnus-tmp-* symbols (their names make
> me think I shouldn't rely on them at all), but it seemed to be the
> most direct way to do it.
Yeah. I think I can guarantee that they won't go away, so they
should be safe to use.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-13 18:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-12 23:45 displaying unseen/unread in *Group* Sean Neakums
2003-01-13 18:21 ` Lars Magne Ingebrigtsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).