From: Roman Belenov <roman@nstl.nnov.ru>
Cc: ding@gnus.org
Subject: Re: New mail indicator
Date: 07 Jan 2000 21:53:10 +0300 [thread overview]
Message-ID: <ur9ftg1d5.fsf@nstl.nnov.ru> (raw)
In-Reply-To: <bt6xhjeu.fsf@apl.washington.edu>
"Jody M. Klymak" <jklymak@apl.washington.edu> writes:
> Roman,
>
> Is it possible to modify the demon to update the modeline? i.e. I
> have the following running under the gnus-use-demon...
>
> (defun gnus-demon-scan-mail-groups1 ()
> (save-window-excursion
> (when (gnus-alive-p)
> (save-excursion
> (set-buffer gnus-group-buffer)
> (gnus-group-get-new-news 1)))))
>
> Is there a way to count how many messages are in the group-1 groups
> and then change the modeline? It would't update the modeline directly
> after your ead your messages, but it would next time you ran the
> demon.
I've added the following to my .gnus to add the number of unread
messages to the modeline (all my mail groups are under "Mail" topic):
(setq my-gnus-unread-mail-articles-p nil)
(setq my-gnus-unread-mail-articles "0")
(defun my-update-gnus-mode-line ()
(let ((unread-articles (gnus-topic-unread "Mail")))
(setq my-gnus-unread-mail-articles-p (> unread-articles 0))
(setq my-gnus-unread-mail-articles (format "%d" unread-articles))
(force-mode-line-update)))
(add-hook 'gnus-after-getting-new-news-hook 'my-update-gnus-mode-line)
(or (boundp 'my-gnus-mode-line-activated)
(progn
(setq my-gnus-mode-line-format
'(my-gnus-unread-mail-articles-p ("Unread: " my-gnus-unread-mail-articles " ")))
(setq global-mode-string (cons my-gnus-mode-line-format global-mode-string))))
(setq my-gnus-mode-line-activated t)
Note that the modeline is not changed then articles are read since I
couldn't find suitable hook.
--
With regards, Roman.
next prev parent reply other threads:[~2000-01-07 18:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-06 19:37 Roman Belenov
2000-01-06 19:53 ` Karl Kleinpaste
2000-01-07 8:28 ` Shigeki Uno
2000-01-07 9:47 ` Roman Belenov
2000-01-07 10:00 ` Kai Großjohann
2000-01-07 10:10 ` Roman Belenov
2000-01-07 10:17 ` Kai Großjohann
2000-01-07 10:34 ` Roman Belenov
2000-01-07 13:02 ` Shigeki Uno
2000-01-07 16:56 ` Roman Belenov
2000-01-07 17:38 ` Jody M. Klymak
2000-01-07 18:53 ` Roman Belenov [this message]
2000-01-07 18:15 ` François Pinard
2000-01-07 18:24 ` Kai Großjohann
[not found] ` <ur9fu19g2.fsf@eai-delta.de>
2000-01-07 10:15 ` Roman Belenov
2000-01-07 10:20 ` Roman Belenov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ur9ftg1d5.fsf@nstl.nnov.ru \
--to=roman@nstl.nnov.ru \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).