From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Gnus state, feed commands Date: Sun, 17 Nov 2013 10:57:39 +0700 Message-ID: <87eh6fvfws.fsf@ericabrahamsen.net> References: <87ob5k1a9q.fsf__48304.1452513591$1384626024$gmane$org@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384660596 1465 80.91.229.3 (17 Nov 2013 03:56:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Nov 2013 03:56:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 17 04:56:40 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 1VhtTR-0008N7-8M for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Nov 2013 04:56:37 +0100 Original-Received: from localhost ([::1]:37901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhtTQ-0000RQ-U3 for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Nov 2013 22:56:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhtTB-0000QQ-S5 for help-gnu-emacs@gnu.org; Sat, 16 Nov 2013 22:56:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhtT5-00089O-Vx for help-gnu-emacs@gnu.org; Sat, 16 Nov 2013 22:56:21 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:52565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhtT5-00089K-P9 for help-gnu-emacs@gnu.org; Sat, 16 Nov 2013 22:56:15 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VhtT3-0008CN-8G for help-gnu-emacs@gnu.org; Sun, 17 Nov 2013 04:56:13 +0100 Original-Received: from 223.204.249.161 ([223.204.249.161]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Nov 2013 04:56:13 +0100 Original-Received: from eric by 223.204.249.161 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Nov 2013 04:56:13 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 223.204.249.161 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:Cgmx8kwXPKdcETsMTcnbe0d0gKA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:94518 Archived-At: Emanuel Berg writes: > In Gnus, I have a group like this: > > mail.misc (5) > > to collect incomings mails. > > I'm thinking, wouldn't it be cool if you never had to > check for mails, instead Emacs did that, and then told > you "you have 5 mails" in the mode line? 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... > I guess I could schedule checking with > `run-with-idle-timer' - coincidentally, that's great, > because when you work (i.e., type) you don't want to be > disturbed and get mails, but when you idle for some > time, it would be a good slot for Emacs to check for > them. > > To change the mode line, I have this in my .emacs: > > (defun set-mode-line () > "Mode line: Show the mode line elements if the > respective global booleans are set." > (interactive) > (setq-default mode-line-format > `(" " > (*show-mode-line-modified* mode-line-modified) > (*show-mode-line-modified* " ") > (*show-mode-line-caption* *mode-line-caption*) > (*show-mode-line-caption* " ") > (*show-default-directory* default-directory) > (*show-mode-line-buffer-identification* mode-line-buffer-identification) > (*show-mode-line-buffer-identification* " ") > (line-number-mode "[%l] ") > (column-number-mode "{%c} ") > (*show-mode-line-modes* mode-line-modes) > ))) > (set-mode-line) > > 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?