Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: A Gnus Biff
       [not found] <mailman.9955.1348869546.855.info-gnus-english@gnu.org>
@ 2012-09-29  4:13 ` Ben Kibbey
  2012-12-24 16:33 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Ben Kibbey @ 2012-09-29  4:13 UTC (permalink / raw)
  To: info-gnus-english

William Gardella <gardellawg@gmail.com> writes:

> Hey,
>
> I'm in the process of writing a simple "biff" for Gnus, to notify me if
> one or more of a list of designated Gnus groups has unread messages in
> it (see below).  So far it crudely works, and is suitable for use
> interactively or by `display-time-mail-function' if you want "Mail" to
> appear in the mode line for Gnus messages instead of mails in your local
> mailspool.  What it doesn't have as yet, as you'll see, is very good
> error handling.

It may be off-topic to the subject, but I wish someone would redo
maildir support in Emacs to handle message flags. I have maildir
mailboxes and use conky to show mailbox status (new messages) then call
gnus-group-get-new-news to refresh the mailbox display after the
messages have been retrieved from fetchmail. The problem is that each
message status is overwritten by gnus (no longer new to conky) and I am
no longer notified of new messages on any workspace (sawfish) until I
visit the gnus frame in another workspace.

I could prevent refreshing the gnus mail status by preventing the
gnus-group-get-new-news call (emacsclient) and keep the conky message
status as new, but then I would still have to refresh the gnus frame to
see the new messages.

Others have had this dillema and I wish I could submit a patch to fix it
but I don't have the elisp expertise. Or maybe I'm missing something?
Maybe there is a better gnus/maildir/conky setup someone else has?

-- 
Ben Kibbey

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A Gnus Biff
       [not found] <mailman.9955.1348869546.855.info-gnus-english@gnu.org>
  2012-09-29  4:13 ` A Gnus Biff Ben Kibbey
@ 2012-12-24 16:33 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2012-12-24 16:33 UTC (permalink / raw)
  To: William Gardella; +Cc: info-gnus-english

William Gardella <gardellawg@gmail.com> writes:

> Is there a function or variable I could use as a condition to determine
> whether Gnus is actually "running?" 

`(gnus-alive-p)'

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A Gnus Biff
  2012-09-28 23:06 ` William Gardella
@ 2012-09-29  7:30   ` Adam Sjøgren
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Sjøgren @ 2012-09-29  7:30 UTC (permalink / raw)
  To: info-gnus-english

On Fri, 28 Sep 2012 19:06:36 -0400, William wrote:

> I notice also that there's a `gnus-after-getting-new-news-hook' which
> might offer another way of running my function,

This is the one you hook gnus-notifications into, so that sounds
reasonable:

,----[ From gnus-notifications.el¹: ]
| ;;; Commentary:
| 
| ;; This implements notifications using `notifications-notify' on new
| ;; messages received.
| ;; Use (add-hook 'gnus-after-getting-new-news-hook 'gnus-notifications)
| ;; to get notifications just after getting the new news.
`----

:-)


  Best regards,

    Adam


¹ http://git.gnus.org/cgit/gnus.git/tree/lisp/gnus-notifications.el

-- 
 "Hur långt man än har kommit                                 Adam Sjøgren
  Är det alltid längre kvar"                             asjo@koldfront.dk

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A Gnus Biff
  2012-09-28 21:58 William Gardella
@ 2012-09-28 23:06 ` William Gardella
  2012-09-29  7:30   ` Adam Sjøgren
  0 siblings, 1 reply; 5+ messages in thread
From: William Gardella @ 2012-09-28 23:06 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

William Gardella <gardellawg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
writes:

> ...
>
> Is there a function or variable I could use as a condition to determine
> whether Gnus is actually "running?"  Eval-after-load is probably not
> quite right, because Gnus is not exactly a normal Elisp package, and
> it's not that I need some function to be available--it's that the group
> data hasn't been populated yet until Gnus is running.  I also considered
> using the variable `gnus-demon-timers' as a condition, since the daemon
> timers are started when gnus starts/restarts and removed when it exits,
> and someone who wants a biff probably does use gnus-demon for periodic
> message checking.  Is that a kludge?  Is there a better way to check the
> status of Gnus?
>
> Thanks in advance for your thoughts,
> WGG

Hmm.  Perhaps `gnus-startup-hook' or `gnus-started-hook' is a
possibility.  I'm not entirely clear as to the difference between them.
I notice also that there's a `gnus-after-getting-new-news-hook' which
might offer another way of running my function, rather than wastefully
running it whenever display-time updates itself...pleasantly, Gnus has
more of an API than it appeared when I started :)  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* A Gnus Biff
@ 2012-09-28 21:58 William Gardella
  2012-09-28 23:06 ` William Gardella
  0 siblings, 1 reply; 5+ messages in thread
From: William Gardella @ 2012-09-28 21:58 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

Hey,

I'm in the process of writing a simple "biff" for Gnus, to notify me if
one or more of a list of designated Gnus groups has unread messages in
it (see below).  So far it crudely works, and is suitable for use
interactively or by `display-time-mail-function' if you want "Mail" to
appear in the mode line for Gnus messages instead of mails in your local
mailspool.  What it doesn't have as yet, as you'll see, is very good
error handling.

I get my data from the function `gnus-list-of-unread-articles' which
I've just ham-fistedly wrapped in an (ignore-errors ...) form.  This
makes it silent enough to be suitable for use on a timer, e.g. with
display-time, but it means that if a group name is invalid, the whole
thing just returns nil as though there was no message in any group.
Also, the way I've done it, if this is loaded by display-time in your
initialization file, it will try to check (of course!).  But in doing
so, it doesn't fully start up Gnus.  It enters some sort of nether
state, where it checks my ~/.authinfo.gpg and makes some IMAP+NNTP
connections, but there's no *Group* buffer, and the function continues
to return nil until Gnus is actually started.

Is there a function or variable I could use as a condition to determine
whether Gnus is actually "running?"  Eval-after-load is probably not
quite right, because Gnus is not exactly a normal Elisp package, and
it's not that I need some function to be available--it's that the group
data hasn't been populated yet until Gnus is running.  I also considered
using the variable `gnus-demon-timers' as a condition, since the daemon
timers are started when gnus starts/restarts and removed when it exits,
and someone who wants a biff probably does use gnus-demon for periodic
message checking.  Is that a kludge?  Is there a better way to check the
status of Gnus?

Thanks in advance for your thoughts,
WGG


[-- Attachment #2: wg-gnus-biff.el --]
[-- Type: application/emacs-lisp, Size: 2529 bytes --]

[-- Attachment #3: Type: text/plain, Size: 183 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english-mXXj517/zsQ@public.gmane.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-24 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.9955.1348869546.855.info-gnus-english@gnu.org>
2012-09-29  4:13 ` A Gnus Biff Ben Kibbey
2012-12-24 16:33 ` Lars Ingebrigtsen
2012-09-28 21:58 William Gardella
2012-09-28 23:06 ` William Gardella
2012-09-29  7:30   ` Adam Sjøgren

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).