From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Gnus state, feed commands Date: Mon, 18 Nov 2013 00:56:41 +0100 Organization: Aioe.org NNTP Server Message-ID: <87bo1i4m5p.fsf@nl106-137-194.student.uu.se> References: <87ob5k1a9q.fsf__48304.1452513591$1384626024$gmane$org@nl106-137-194.student.uu.se> <87bo1jjg1w.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1384732813 26396 80.91.229.3 (18 Nov 2013 00:00:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Nov 2013 00:00:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 18 01:00:19 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ViCGJ-00034V-5o for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Nov 2013 01:00:19 +0100 Original-Received: from localhost ([::1]:40694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViCGI-0003tV-M7 for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Nov 2013 19:00:18 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: VVbyYd/iFZoeWNmD9i++cQ.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:NmfgCTCDGOrVs+G99njBuOKN2cE= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:202259 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94528 Archived-At: Emanuel Berg writes: > Eric Abrahamsen 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