Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: wgreenhouse-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org (W. Greenhouse)
To: info-gnus-english-mXXj517/zsQ@public.gmane.org
Subject: Re: Gnus state, feed commands
Date: Sat, 16 Nov 2013 19:31:21 +0000	[thread overview]
Message-ID: <87iovskut2.fsf@motoko.kusanagi> (raw)
In-Reply-To: <87ob5k1a9q.fsf@nl106-137-194.student.uu.se>

Emanuel Berg <embe8573-oe7qfRrRQfc4M/bo5TPICw@public.gmane.org> 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

  reply	other threads:[~2013-11-16 19:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16 18:17 Emanuel Berg
2013-11-16 19:31 ` W. Greenhouse [this message]
     [not found] ` <mailman.6381.1384630484.10748.info-gnus-english@gnu.org>
2013-11-16 20:03   ` Emanuel Berg
2013-11-17 23:57     ` Emanuel Berg
2013-11-20 23:00       ` W. Greenhouse
     [not found]       ` <mailman.6725.1384988464.10748.info-gnus-english@gnu.org>
2013-11-21 22:54         ` 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=87iovskut2.fsf@motoko.kusanagi \
    --to=wgreenhouse-sgozh3hwpm2stnjn9+bgxg@public.gmane.org \
    --cc=info-gnus-english-mXXj517/zsQ@public.gmane.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).