Gnus development mailing list
 help / color / mirror / Atom feed
* Hooking on to new messages
@ 1997-11-25  8:16 Urban Engberg
  1997-11-25 13:45 ` Urban Engberg
  0 siblings, 1 reply; 5+ messages in thread
From: Urban Engberg @ 1997-11-25  8:16 UTC (permalink / raw)


I am trying to make Gnus notify me whenever there is new mail, but
only when it's personal.  I don't want to use procmail, so I use Gnus'
mail-splitting (nnmail-split-fancy) and add a mail scanning daemon
like this:

  (gnus-demon-add-handler 'gnus-demon-scan-mail 1 nil)

Now, to detect when there is some interesting mail, I have tried

  (add-hook 'nnml-prepare-save-mail-hook 'ue-gnus-article-notify)

(or alternatively nnmail-prepare-save-mail-hook).
ue-gnus-article-notify should thus get called on each new message, and
may for instance look for the new X-ref header and produce some sort
of notification when I want it to.

The strange thing is that this seems to work most of the time -- when
I am actively working inside Emacs, that is.  When I leave Emacs for
some time, I can see that gnus-demon-scan-mail gets called as it
should every minute, but ue-gnus-article-notify is never being
called.  I've tried to debug, but without success (as I said, when I
am working in Emacs, it seems to work).  Am I using the right hook?
Some better way to do this?

  Urban

-- 
ue * 105


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

* Re: Hooking on to new messages
  1997-11-25  8:16 Hooking on to new messages Urban Engberg
@ 1997-11-25 13:45 ` Urban Engberg
  1997-11-25 19:07   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Urban Engberg @ 1997-11-25 13:45 UTC (permalink / raw)


Hm..  The problem seems to be that my mail-spool (/usr/spool/mail/...)
is not always being read by gnus-demon-scan-mail.  It seems to think
there is no new mail, even though this is the case.  I still can't
figure out why.  But obviously, it is not the hook that is wrong.

-- 
ue@cci.dk


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

* Re: Hooking on to new messages
  1997-11-25 13:45 ` Urban Engberg
@ 1997-11-25 19:07   ` Lars Magne Ingebrigtsen
  1997-11-26  9:05     ` Urban Engberg
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-11-25 19:07 UTC (permalink / raw)


Urban Engberg <ue@cci.dk> writes:

> Hm..  The problem seems to be that my mail-spool (/usr/spool/mail/...)
> is not always being read by gnus-demon-scan-mail.  It seems to think
> there is no new mail, even though this is the case. 

Hm.  That's weird.  `nnmail-spool-file' doesn't get reset in some
strange manner somewhere?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: Hooking on to new messages
  1997-11-25 19:07   ` Lars Magne Ingebrigtsen
@ 1997-11-26  9:05     ` Urban Engberg
  1997-11-26  9:31       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Urban Engberg @ 1997-11-26  9:05 UTC (permalink / raw)


I think I have solved the problem.  nnmail-move-inbox, which is called
by nnmail-get-new-mail, sets the list nnmail-moved-inboxes to contain
my mail spool path the first time some new mail is read.  And
nnmail-moved-inboxes doesn't get reset to nil unless I enter a Gnus
group or summary buffer for some reason (it's cleared by the
post-command-hook there).  As long as it contains my mail spool,
however, nnmail-move-inbox will constantly return nil, making
nnmail-get-new-mail think that there is no new mail.

I fixed this for myself by creating a "ue-gnus-demon-scan-mail" that
calls (gnus-clear-inboxes-moved) before doing anything else.

Seems like a bug to me.

-- 
ue@cci.dk


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

* Re: Hooking on to new messages
  1997-11-26  9:05     ` Urban Engberg
@ 1997-11-26  9:31       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-11-26  9:31 UTC (permalink / raw)


Urban Engberg <ue@cci.dk> writes:

> I think I have solved the problem.  nnmail-move-inbox, which is called
> by nnmail-get-new-mail, sets the list nnmail-moved-inboxes to contain
> my mail spool path the first time some new mail is read.  And
> nnmail-moved-inboxes doesn't get reset to nil

Yup.  Fix in Quassia Gnus v0.17.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

end of thread, other threads:[~1997-11-26  9:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-25  8:16 Hooking on to new messages Urban Engberg
1997-11-25 13:45 ` Urban Engberg
1997-11-25 19:07   ` Lars Magne Ingebrigtsen
1997-11-26  9:05     ` Urban Engberg
1997-11-26  9:31       ` Lars Magne Ingebrigtsen

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