From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/16579 Path: news.gmane.org!not-for-mail From: wgreenhouse-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org (W. Greenhouse) Newsgroups: gmane.emacs.gnus.user Subject: Re: Gnus state, feed commands Date: Sat, 16 Nov 2013 19:31:21 +0000 Message-ID: <87iovskut2.fsf@motoko.kusanagi> References: <87ob5k1a9q.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1384630580 17456 80.91.229.3 (16 Nov 2013 19:36:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Nov 2013 19:36:20 +0000 (UTC) To: info-gnus-english-mXXj517/zsQ@public.gmane.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Sat Nov 16 20:36:26 2013 Return-path: Envelope-to: gegu-info-gnus-english@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 1Vhldk-0007qn-Qt for gegu-info-gnus-english@m.gmane.org; Sat, 16 Nov 2013 20:34:44 +0100 Original-Received: from localhost ([::1]:37017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vhldk-0000Rf-EU for gegu-info-gnus-english@m.gmane.org; Sat, 16 Nov 2013 14:34:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vhldc-0000RE-Pf for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sat, 16 Nov 2013 14:34:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhldU-0000Hz-Ex for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sat, 16 Nov 2013 14:34:36 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:55792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhldU-0000Hk-8K for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sat, 16 Nov 2013 14:34:28 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VhlcC-0005hY-Sx for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sat, 16 Nov 2013 20:33:08 +0100 Original-Received: from herngaard.torservers.net ([96.44.189.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Nov 2013 20:33:08 +0100 Original-Received: from wgreenhouse by herngaard.torservers.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Nov 2013 20:33:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet-dbVV3NMTNubNLxjTenLetw@public.gmane.org X-Gmane-NNTP-Posting-Host: herngaard.torservers.net X-Archive: encrypt User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:ySTOcVUpE464QkADb/2WxWx7enc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.gnus.user:16579 Archived-At: Emanuel Berg writes: [...] > So you see, putting that information in the mode line > shouldn't be that difficult. > > But what I don't know is: how do I access the "state" > of Gnus? I.e., how do I get that number "5"? And, how > do I feed command to Gnus, in the background, without > switching buffers or triggering any other visual noise? There are some functions you can use which take the name of the group as displayed in the *Group* buffer, given as a string. For example, (gnus-number-of-unseen-articles-in-group "mail.misc") which returns an integer. Obviously, you could track several groups and add them together, since the return value of this function is a number. As for the idle timer part of your scheme, consider using (info "(gnus) Daemons"), which is Gnus's built-in interface to the Emacs timer facility. Conveniently, this will let you start the timers when Gnus is started, and tear them down if you quit Gnus, which saves you from some of the trouble of handling errors when information from the groups isn't available. -- Regards, WGG