Gnus development mailing list
 help / color / mirror / Atom feed
* request for simple handler or batch job to get mail/news
@ 2004-06-30 21:02 Harry Putnam
       [not found] ` <hhk6xoctu3.fsf@blah.pl>
  0 siblings, 1 reply; 6+ messages in thread
From: Harry Putnam @ 2004-06-30 21:02 UTC (permalink / raw)


I'd like to see some examples of what people use to automatically get
mail/news when gnus is running. 

I once had a batch job run from cron that did it and then passed the
info to an uplugged gnus instance.  That was pretty good but could
get sort of out of sync.  And you had to batch outgoing stuff too.

I'm thinking handlers can do this, but it seems you'd want something
to run on a time schedule not related to when emacs is idle. 

Anyway, can we see some examples known to be trouble free or close that
people are using to get news/mail every so often?




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

* Re: request for simple handler or batch job to get mail/news
       [not found] ` <hhk6xoctu3.fsf@blah.pl>
@ 2004-07-01 11:08   ` Harry Putnam
  2004-07-01 12:41     ` Maciej Matysiak
  2004-07-01 12:31   ` Harry Putnam
  2004-07-03  9:47   ` Marcus Frings
  2 siblings, 1 reply; 6+ messages in thread
From: Harry Putnam @ 2004-07-01 11:08 UTC (permalink / raw)


Maciej Matysiak <phoner.ding@blah.pl> writes:

> [Quoted text removed due to X-No-Archive]

Aside:  Macie did you intend for the above action to happen when
        pressing `F' (followup)?

Apparently your X-No-Archive header causes gnus to insert the above
line and not yank your message into reply buffer.


Now on the handler:
I wondered if this section:

> (defun gnus-demon-scan-mail ()
>  (when (and (gnus-alive-p) mail-here)
>    (save-excursion
>      (set-buffer gnus-group-buffer)
>      (gnus-group-get-new-news 2))))

Means that your mail groups have to be at level 2?.  And further that
if I were to put a 3 there which includes all mail and news groups,
if that would make that particular handler fetch both?




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

* Re: request for simple handler or batch job to get mail/news
       [not found] ` <hhk6xoctu3.fsf@blah.pl>
  2004-07-01 11:08   ` Harry Putnam
@ 2004-07-01 12:31   ` Harry Putnam
  2004-07-01 14:12     ` Maciej Matysiak
  2004-07-03  9:47   ` Marcus Frings
  2 siblings, 1 reply; 6+ messages in thread
From: Harry Putnam @ 2004-07-01 12:31 UTC (permalink / raw)


Maciej Matysiak <phoner.ding@blah.pl> writes:

> [Quoted text removed due to X-No-Archive]

I've added this modified version to a file gnus reads on startup:
  (setq gnus-use-demon t)
  (gnus-demon-init)
  (gnus-demon-add-rescan)
  
  (defun gnus-demon-scan-mail ()
    (when (and (gnus-alive-p) mail-here)
      (save-excursion
        (set-buffer gnus-group-buffer)
        (gnus-group-get-new-news 3))))
  
  (gnus-demon-add-handler 'gnus-demon-scan-mail 7 1)

Then left gnus alone for over 25 minutes.... 
During that 25 minutes I mailed myself several messages from the
command line.  I see them appear in the spool directory where gnus
gets its mail.

However none are pulled into gnus.

After reading the section on `handlers' I'm thinking the above code
should pull in mail every 7 minutes if gnus has been idle for 1
minute.

How can I debug this... I see no evidence that anything has happened
at all.  Nothing appears in *Messages* buffer.

Loading the code directly from here seems to have no effect either.





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

* Re: request for simple handler or batch job to get mail/news
  2004-07-01 11:08   ` Harry Putnam
@ 2004-07-01 12:41     ` Maciej Matysiak
  0 siblings, 0 replies; 6+ messages in thread
From: Maciej Matysiak @ 2004-07-01 12:41 UTC (permalink / raw)


On the 1st of July 2004 at 13:08, Harry Putnam <reader#newsguy.com> wrote:

>> [Quoted text removed due to X-No-Archive]
> Aside: Maciej did you intend for the above action to happen when pressing `F'
> (followup)?

add the header? yes. quoted text being removed by gnus due to it? no :)

> Apparently your X-No-Archive header causes gnus to insert the above
> line and not yank your message into reply buffer.

that's something new for me, must be one of larsi's ideas ;)
that header was intended for protection of my e-mail address stored in various
archives, but it's already in spammers' databases :(

> Now on the handler:
> I wondered if this section:
>
>> (defun gnus-demon-scan-mail ()
>>  (when (and (gnus-alive-p) mail-here)
>>    (save-excursion
>>      (set-buffer gnus-group-buffer)
>>      (gnus-group-get-new-news 2))))
>
> Means that your mail groups have to be at level 2?

yes, my e-mail is stored in nnml groups which all have level 2.

> And further that if I were to put a 3 there which includes all mail and news
> groups, if that would make that particular handler fetch both?

i guess so.
the reason i have mail on level 2 and news on level 3 is that the connection
to news server is much slower than to my mail server, so checking news status
every few minutes would be pain. and updating information about news groups
is another few wasted seconds.

 m.m.
-- 
 use gnus, not guns!



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

* Re: request for simple handler or batch job to get mail/news
  2004-07-01 12:31   ` Harry Putnam
@ 2004-07-01 14:12     ` Maciej Matysiak
  0 siblings, 0 replies; 6+ messages in thread
From: Maciej Matysiak @ 2004-07-01 14:12 UTC (permalink / raw)


On the 1st of July 2004 at 14:31, Harry Putnam <reader#newsguy.com> wrote:

>     (when (and (gnus-alive-p) mail-here)

what if you left only
 (when (gnus-alive-p)
instead?

the original function works here, however i can't find any reference to
"mail-here", a bit mysterious ;)

 m.m.
-- 
 use gnus, not guns!



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

* Re: request for simple handler or batch job to get mail/news
       [not found] ` <hhk6xoctu3.fsf@blah.pl>
  2004-07-01 11:08   ` Harry Putnam
  2004-07-01 12:31   ` Harry Putnam
@ 2004-07-03  9:47   ` Marcus Frings
  2 siblings, 0 replies; 6+ messages in thread
From: Marcus Frings @ 2004-07-03  9:47 UTC (permalink / raw)


* Maciej Matysiak <phoner.ding@blah.pl> wrote:
> On the 30th of June 2004 at 23:02, Harry Putnam <reader#newsguy.com> wrote:

>> I'd like to see some examples of what people use to automatically get
>> mail/news when gnus is running. 

> my gnus runs sometimes for weeks, and of course takes care of checking mail

> (often) and news (not too often) when i don't touch the keyboard. the relevant
> part of my .gnus:

> (setq gnus-use-demon t)
> (gnus-demon-init)
> (gnus-demon-add-rescan)

> (defun gnus-demon-scan-mail ()
>   (when (and (gnus-alive-p) mail-here)
>     (save-excursion
>       (set-buffer gnus-group-buffer)
>       (gnus-group-get-new-news 2))))

> (defun gnus-demon-scan-news ()
>   (when (gnus-alive-p)
>     (save-excursion
>       (set-buffer gnus-group-buffer)
>       (gnus-group-get-new-news))))

> (gnus-demon-add-handler 'gnus-demon-scan-mail 3 6)
> (gnus-demon-add-handler 'gnus-demon-scan-news 66 6)

> i'm not sure where i got that from ;) but i've been using it for, like, years.

Me, too. Recently we have discussed this in gnu.emacs.help (see my posting
with the MID
<vita-brevis-breviter-in-brevi-finietur-mors-venit-velociter-quae-neminem-veretur-87659ip8vj.fsf@shodan.gothgoose.net>
and the thread around).

You can delete the complete code in your configuration and you only
have to add this single line

(gnus-demon-add-handler 'gnus-demon-scan-news 5 10)

to make Gnus check both mails and news.

Regards,
Marcus
-- 
"Did you really think I would not deduce where you would run to, insect?"
                                                 (Shodan in System Shock)




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

end of thread, other threads:[~2004-07-03  9:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-30 21:02 request for simple handler or batch job to get mail/news Harry Putnam
     [not found] ` <hhk6xoctu3.fsf@blah.pl>
2004-07-01 11:08   ` Harry Putnam
2004-07-01 12:41     ` Maciej Matysiak
2004-07-01 12:31   ` Harry Putnam
2004-07-01 14:12     ` Maciej Matysiak
2004-07-03  9:47   ` Marcus Frings

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