From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Gnus state, feed commands
Date: Mon, 18 Nov 2013 00:56:41 +0100 [thread overview]
Message-ID: <87bo1i4m5p.fsf@nl106-137-194.student.uu.se> (raw)
In-Reply-To: 87bo1jjg1w.fsf@nl106-137-194.student.uu.se
Emanuel Berg <embe8573@student.uu.se> writes:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> That number above comes from the function
>> gnus-group-unread, so you could probably map all
>> subscribed groups through it and collect the unread
>> count. I've never messed with the mode line, so I'm
>> not sure about using a function to produce a value
>> for it...
>
> Yes, I was told on gnu.emacs.gnus that I was possible
> to do like this:
>
> (gnus-number-of-unseen-articles-in-group "gnu.emacs.help")
I "sort of" solved this. Check out the comments.
(defvar *unread-mails*)
(setq *unread-mails* "")
(defun update-unread-mails ()
(let ((num-msgs (gnus-number-of-unseen-articles-in-group "alt.test")))
(setq *unread-mails*
(if (< 0 num-msgs) "* MAIL *" "") )))
;; I found it to be much better not to use the number.
;; Then you stare at that digit - could be 0, could be
;; 7, could it be... Zzz... until you get dizzy. The
;; idea was to have the computer tell you about mails,
;; not have *you* stare into a digit.
(defun gnus-get-news-bg ()
(interactive)
(let ((ori-buffer (current-buffer)))
(gnus-start-or-show) ; basically (gnus)
(switch-to-buffer ori-buffer) )) ; can this be avoided?
(defun gnus-after-init ()
(gnus-demon-add-handler 'gnus-get-news-bg 1 t)
(gnus-demon-init) )
(add-hook 'gnus-started-hook 'gnus-after-init)
(add-hook 'gnus-get-new-news-hook 'update-unread-mails)
(add-hook 'gnus-agent-fetched-hook 'update-unread-mails)
(add-hook 'gnus-group-catchup-group-hook 'update-unread-mails)
;; One would think, there should be just one hook, to
;; reflect the change of state of the set of groups
;; *and* their unseen articles.
--
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united: http://user.it.uu.se/~embe8573
next prev parent reply other threads:[~2013-11-17 23:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-16 18:17 Gnus state, feed commands Emanuel Berg
2013-11-16 18:25 ` Bastien
[not found] ` <mailman.6374.1384626320.10748.help-gnu-emacs@gnu.org>
2013-11-16 18:31 ` Emanuel Berg
2013-11-16 18:50 ` Bastien
[not found] ` <mailman.6376.1384627827.10748.help-gnu-emacs@gnu.org>
2013-11-16 19:16 ` Emanuel Berg
2013-11-16 19:23 ` Eli Zaretskii
2013-11-17 3:57 ` Eric Abrahamsen
[not found] ` <mailman.6403.1384660589.10748.help-gnu-emacs@gnu.org>
2013-11-17 13:47 ` Emanuel Berg
2013-11-17 23:56 ` Emanuel Berg [this message]
2013-11-18 2:43 ` Eric Abrahamsen
[not found] ` <mailman.6460.1384742532.10748.help-gnu-emacs@gnu.org>
2013-11-18 22:11 ` Emanuel Berg
2013-11-19 1:53 ` Eric Abrahamsen
[not found] ` <mailman.6527.1384825935.10748.help-gnu-emacs@gnu.org>
2013-11-19 2:07 ` Emanuel Berg
2013-11-19 8:50 ` Eric Abrahamsen
[not found] ` <mailman.6544.1384850944.10748.help-gnu-emacs@gnu.org>
2013-11-19 22:31 ` Size of Gnus and Emacs (was: Re: Gnus state, feed commands) Emanuel Berg
2013-11-20 3:34 ` Size of Gnus and Emacs Jambunathan K
[not found] ` <mailman.6582.1384918585.10748.help-gnu-emacs@gnu.org>
2013-11-20 3:41 ` Emanuel Berg
2013-11-20 7:48 ` Eric Abrahamsen
[not found] ` <mailman.6592.1384933633.10748.help-gnu-emacs@gnu.org>
2013-11-20 16:35 ` Emanuel Berg
2013-11-21 0:59 ` Eric Abrahamsen
2013-12-01 6:49 ` Jambunathan K
[not found] ` <mailman.7692.1385880597.10748.help-gnu-emacs@gnu.org>
2013-12-01 16:46 ` Emanuel Berg
2013-12-02 5:29 ` Jambunathan K
2013-12-02 16:48 ` Emanuel Berg
2013-12-02 5:51 ` Jambunathan K
2013-12-02 16:53 ` Emanuel Berg
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=87bo1i4m5p.fsf@nl106-137-194.student.uu.se \
--to=embe8573@student.uu.se \
--cc=help-gnu-emacs@gnu.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.