Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-demon question
@ 2010-12-22  6:47 Noorul Islam K M
  2010-12-22  7:49 ` Tassilo Horn
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Noorul Islam K M @ 2010-12-22  6:47 UTC (permalink / raw)
  To: ding


I have the following settings.

(gnus-demon-add-handler 'gnus-group-get-new-news 15 t)
(gnus-demon-init)

But still it looks like, emacs is not checking mails every 15 minutes
and also the *Group* buffer is not getting updated.

I use

No Gnus v0.11
GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.12.12)
 of 2010-11-26 on noorul

Everything works fine with Gnus

I hope someone else might also be facing similar problem. Anyone?

Thanks and Regards
Noorul



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

* Re: gnus-demon question
  2010-12-22  6:47 gnus-demon question Noorul Islam K M
@ 2010-12-22  7:49 ` Tassilo Horn
  2010-12-22  8:49   ` Noorul Islam K M
  2011-01-03 11:58 ` Noorul Islam K M
  2011-01-04  0:02 ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 17+ messages in thread
From: Tassilo Horn @ 2010-12-22  7:49 UTC (permalink / raw)
  To: Noorul Islam K M; +Cc: ding

Noorul Islam K M <noorul@noorul.com> writes:

> I have the following settings.
>
> (gnus-demon-add-handler 'gnus-group-get-new-news 15 t)
> (gnus-demon-init)

The `gnus-demon-init' is not needed.  `gnus-demon-add-handler' calls it
already.  Your code 1) adds a new handler, 2) kills all old handlers and
initializes them anew (gnus-demon-init), and then does 2) again.

> But still it looks like, emacs is not checking mails every 15 minutes
> and also the *Group* buffer is not getting updated.

Looking at the docs

,----[ (info "(gnus)Daemons") ]
|    If IDLE is `t', then the function will be called after TIME minutes
| only if Emacs is idle.  So if Emacs is never idle, the function will
| never be called.  But once Emacs goes idle, the function will be called
| every TIME minutes.
`----

Hm, reading that statement, I'd say that your code would check every 15
minutes if emacs is idle, and if so, call `gnus-group-get-new-news'.

But looking at the code

  (gnus-demon-add-handler 'gnus-group-get-new-news 15 t)

is equivalent to

  (gnus-demon-add-handler 'gnus-group-get-new-news 15 15)

,----[ (info "(gnus)Daemons") ]
|    If IDLE is a number and TIME is a number, the function will be
| called every TIME minutes only when Emacs has been idle for IDLE
| minutes.
`----

So your code will call `gnus-group-get-new-news' every 15 minutes after
emacs has been idle for at least 15 minutes.  That's pretty seldomly, I
guess...

So what's wrong?  Code, documentation, or my understanding of the code?

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: gnus-demon question
  2010-12-22  7:49 ` Tassilo Horn
@ 2010-12-22  8:49   ` Noorul Islam K M
  0 siblings, 0 replies; 17+ messages in thread
From: Noorul Islam K M @ 2010-12-22  8:49 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

Tassilo Horn <tassilo@member.fsf.org> writes:

> Noorul Islam K M <noorul@noorul.com> writes:
>
>> I have the following settings.
>>
>> (gnus-demon-add-handler 'gnus-group-get-new-news 15 t)
>> (gnus-demon-init)
>
> The `gnus-demon-init' is not needed.  `gnus-demon-add-handler' calls it
> already.  Your code 1) adds a new handler, 2) kills all old handlers and
> initializes them anew (gnus-demon-init), and then does 2) again.
>
>> But still it looks like, emacs is not checking mails every 15 minutes
>> and also the *Group* buffer is not getting updated.
>
> Looking at the docs
>
> ,----[ (info "(gnus)Daemons") ]
> |    If IDLE is `t', then the function will be called after TIME minutes
> | only if Emacs is idle.  So if Emacs is never idle, the function will
> | never be called.  But once Emacs goes idle, the function will be called
> | every TIME minutes.
> `----
>
> Hm, reading that statement, I'd say that your code would check every 15
> minutes if emacs is idle, and if so, call `gnus-group-get-new-news'.
>
> But looking at the code
>
>   (gnus-demon-add-handler 'gnus-group-get-new-news 15 t)
>
> is equivalent to
>
>   (gnus-demon-add-handler 'gnus-group-get-new-news 15 15)
>
> ,----[ (info "(gnus)Daemons") ]
> |    If IDLE is a number and TIME is a number, the function will be
> | called every TIME minutes only when Emacs has been idle for IDLE
> | minutes.
> `----
>
> So your code will call `gnus-group-get-new-news' every 15 minutes after
> emacs has been idle for at least 15 minutes.  That's pretty seldomly, I
> guess...
>
> So what's wrong?  Code, documentation, or my understanding of the code?

The same setup was working when I was using Gnus. I use emacs as I was
using earlier. So the idleness remains the same. There are days when I
lock the system for several hours. Still there is no effect.

Thanks and Regards
Noorul



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

* Re: gnus-demon question
  2010-12-22  6:47 gnus-demon question Noorul Islam K M
  2010-12-22  7:49 ` Tassilo Horn
@ 2011-01-03 11:58 ` Noorul Islam K M
  2011-01-04  0:02 ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 17+ messages in thread
From: Noorul Islam K M @ 2011-01-03 11:58 UTC (permalink / raw)
  To: ding

Noorul Islam K M <noorul@noorul.com> writes:

> I have the following settings.
>
> (gnus-demon-add-handler 'gnus-group-get-new-news 15 t)
> (gnus-demon-init)
>
> But still it looks like, emacs is not checking mails every 15 minutes
> and also the *Group* buffer is not getting updated.
>
> I use
>
> No Gnus v0.11
> GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.12.12)
>  of 2010-11-26 on noorul
>
> Everything works fine with Gnus
>
> I hope someone else might also be facing similar problem. Anyone?
>

If someone could help me here then it will be great.

Thanks and Regards
Noorul



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

* Re: gnus-demon question
  2010-12-22  6:47 gnus-demon question Noorul Islam K M
  2010-12-22  7:49 ` Tassilo Horn
  2011-01-03 11:58 ` Noorul Islam K M
@ 2011-01-04  0:02 ` Lars Magne Ingebrigtsen
  2011-01-04  5:58   ` Noorul Islam K M
  2011-01-04  7:54   ` Tassilo Horn
  2 siblings, 2 replies; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-04  0:02 UTC (permalink / raw)
  To: ding

Noorul Islam K M <noorul@noorul.com> writes:

> (gnus-demon-add-handler 'gnus-group-get-new-news 15 t)

I've never used that, and I'm not sure whether that's supposed to work
or not.  Anybody?

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




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

* Re: gnus-demon question
  2011-01-04  0:02 ` Lars Magne Ingebrigtsen
@ 2011-01-04  5:58   ` Noorul Islam K M
  2011-01-04 11:34     ` Adam Sjøgren
  2011-01-04  7:54   ` Tassilo Horn
  1 sibling, 1 reply; 17+ messages in thread
From: Noorul Islam K M @ 2011-01-04  5:58 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Noorul Islam K M <noorul@noorul.com> writes:
>
>> (gnus-demon-add-handler 'gnus-group-get-new-news 15 t)
>
> I've never used that, and I'm not sure whether that's supposed to work
> or not.  Anybody?

How do we make gnus to check mails at regular intervals? If there is any
other way then it will be great to know.

Thanks and Regards
Noorul



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

* Re: gnus-demon question
  2011-01-04  0:02 ` Lars Magne Ingebrigtsen
  2011-01-04  5:58   ` Noorul Islam K M
@ 2011-01-04  7:54   ` Tassilo Horn
  1 sibling, 0 replies; 17+ messages in thread
From: Tassilo Horn @ 2011-01-04  7:54 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

Hi!

>> (gnus-demon-add-handler 'gnus-group-get-new-news 15 t)
>
> I've never used that, and I'm not sure whether that's supposed to work
> or not.  Anybody?

I use this (first param is TIME, second is IDLE)

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

The docs say

,----[ (info "(gnus)Daemons") ]
|    If IDLE is a number and TIME is a number, the function will be
| called every TIME minutes only when Emacs has been idle for IDLE
| minutes.
`----

so I'd expect it to run every 15 minutes but only if emacs has been idle
for 5 minutes.

Nevertheless, that doesn't match my observations.  It seems, that the
docs are correct for the first run, but any subsequent run doesn't check
if emacs has been idle.  Often, I'm writing in emacs, do a 15 seconds
thinking pause, and then I can see Gnus checking for new mail/news.

Well, because that's so fast nowadays, it's not a big issue for me.  But
the docs don't seem to be correct...

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: gnus-demon question
  2011-01-04  5:58   ` Noorul Islam K M
@ 2011-01-04 11:34     ` Adam Sjøgren
  2011-01-04 12:06       ` Noorul Islam K M
  0 siblings, 1 reply; 17+ messages in thread
From: Adam Sjøgren @ 2011-01-04 11:34 UTC (permalink / raw)
  To: ding

On Tue, 04 Jan 2011 11:28:04 +0530, Noorul Islam wrote:

> How do we make gnus to check mails at regular intervals? If there is any
> other way then it will be great to know.

I use this in my ~/.gnus:

  ; Daemon to fetch email every 5 minutes when Emacs has been idle for 5 minutes:
  (gnus-demon-add-handler 'gnus-demon-scan-mail 5 5)
  (gnus-demon-init)

Works like a charm (note that I don't think this updates the *Group*
buffer; I am not 100% sure though).


  Best regards,

    Adam

-- 
 "Accept the mystery!"                                        Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: gnus-demon question
  2011-01-04 11:34     ` Adam Sjøgren
@ 2011-01-04 12:06       ` Noorul Islam K M
  2011-01-04 12:56         ` Adam Sjøgren
  0 siblings, 1 reply; 17+ messages in thread
From: Noorul Islam K M @ 2011-01-04 12:06 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> On Tue, 04 Jan 2011 11:28:04 +0530, Noorul Islam wrote:
>
>> How do we make gnus to check mails at regular intervals? If there is any
>> other way then it will be great to know.
>
> I use this in my ~/.gnus:
>
>   ; Daemon to fetch email every 5 minutes when Emacs has been idle for 5 minutes:
>   (gnus-demon-add-handler 'gnus-demon-scan-mail 5 5)
>   (gnus-demon-init)
>
> Works like a charm (note that I don't think this updates the *Group*
> buffer; I am not 100% sure though).
>

Then how do you know that new mails arrived?

Thanks and Regards
Noorul



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

* Re: gnus-demon question
  2011-01-04 12:06       ` Noorul Islam K M
@ 2011-01-04 12:56         ` Adam Sjøgren
  2011-01-04 13:13           ` Robert Pluim
  0 siblings, 1 reply; 17+ messages in thread
From: Adam Sjøgren @ 2011-01-04 12:56 UTC (permalink / raw)
  To: ding

On Tue, 04 Jan 2011 17:36:18 +0530, Noorul Islam wrote:

>> ; Daemon to fetch email every 5 minutes when Emacs has been idle for 5 minutes:
>> (gnus-demon-add-handler 'gnus-demon-scan-mail 5 5)
>> (gnus-demon-init)
 
>> Works like a charm (note that I don't think this updates the *Group*
>> buffer; I am not 100% sure though).

> Then how do you know that new mails arrived?

I go 'g'.

(And I realize that probably isn't what you want; my setup isn't that
vanilla - among other things I forward emails to my phone when email is
fetched by the demon, but not when fetched by (my) hand.)

Hopefully someone else can either tell us that I am wrong about the
*Group* or tell us how to have it update :-)


  Best regards,

    Adam

-- 
 "Accept the mystery!"                                        Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: gnus-demon question
  2011-01-04 12:56         ` Adam Sjøgren
@ 2011-01-04 13:13           ` Robert Pluim
  2011-01-04 14:22             ` Adam Sjøgren
  0 siblings, 1 reply; 17+ messages in thread
From: Robert Pluim @ 2011-01-04 13:13 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> On Tue, 04 Jan 2011 17:36:18 +0530, Noorul Islam wrote:
>
>>> ; Daemon to fetch email every 5 minutes when Emacs has been idle for 5 minutes:
>>> (gnus-demon-add-handler 'gnus-demon-scan-mail 5 5)
>>> (gnus-demon-init)
>  
>>> Works like a charm (note that I don't think this updates the *Group*
>>> buffer; I am not 100% sure though).
>
>> Then how do you know that new mails arrived?
>
> I go 'g'.
>
> (And I realize that probably isn't what you want; my setup isn't that
> vanilla - among other things I forward emails to my phone when email is
> fetched by the demon, but not when fetched by (my) hand.)
>
> Hopefully someone else can either tell us that I am wrong about the
> *Group* or tell us how to have it update :-)

I do:

(gnus-demon-add-handler 'gnus-group-get-new-news 5 3)

which updates the *Group* buffer fine (plus I don't bother with
gnus-demon-init)

Robert




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

* Re: gnus-demon question
  2011-01-04 13:13           ` Robert Pluim
@ 2011-01-04 14:22             ` Adam Sjøgren
  2011-01-04 14:47               ` Adam Sjøgren
  2011-01-04 16:56               ` Tassilo Horn
  0 siblings, 2 replies; 17+ messages in thread
From: Adam Sjøgren @ 2011-01-04 14:22 UTC (permalink / raw)
  To: ding

On Tue, 04 Jan 2011 14:13:38 +0100, Robert wrote:

> asjo@koldfront.dk (Adam Sjøgren) writes:

>>>> ; Daemon to fetch email every 5 minutes when Emacs has been idle for 5 minutes:
>>>> (gnus-demon-add-handler 'gnus-demon-scan-mail 5 5)
>>>> (gnus-demon-init)

>>>> Works like a charm (note that I don't think this updates the *Group*
>>>> buffer; I am not 100% sure though).

[...]

>> Hopefully someone else can either tell us that I am wrong about the
>> *Group* or tell us how to have it update :-)

> I do:

> (gnus-demon-add-handler 'gnus-group-get-new-news 5 3)

> which updates the *Group* buffer fine

So basically gnus-demon-scan-news without the wrapping?

I think I use gnus-demon-scan-mail because I don't need the news-servers
to be bothered when I am not at the Emacs. It would be nice the the
*Group* buffer was updated though.

I should test to see if it is just my imagination, or it really isn't
updated...

> (plus I don't bother with gnus-demon-init)

That isn't necessary?


  Best regards,

    Adam

-- 
 "Accept the mystery!"                                        Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: gnus-demon question
  2011-01-04 14:22             ` Adam Sjøgren
@ 2011-01-04 14:47               ` Adam Sjøgren
  2011-01-04 16:56               ` Tassilo Horn
  1 sibling, 0 replies; 17+ messages in thread
From: Adam Sjøgren @ 2011-01-04 14:47 UTC (permalink / raw)
  To: ding

On Tue, 04 Jan 2011 15:22:31 +0100, Adam wrote:

> I should test to see if it is just my imagination, or it really isn't
> updated...

It really isn't. I will try the scan-news version and see if that isn't
more fun.

Thanks for the nudge!


  Best regards,

    Adam

-- 
 "Accept the mystery!"                                        Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: gnus-demon question
  2011-01-04 14:22             ` Adam Sjøgren
  2011-01-04 14:47               ` Adam Sjøgren
@ 2011-01-04 16:56               ` Tassilo Horn
  2011-01-04 18:02                 ` Adam Sjøgren
  1 sibling, 1 reply; 17+ messages in thread
From: Tassilo Horn @ 2011-01-04 16:56 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

>> (plus I don't bother with gnus-demon-init)
>
> That isn't necessary?

No, `gnus-demon-add-handler' calls it for you.  Calling it explicitly
again will cancel all timers and initialize them anew for a second
time. :-)

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: gnus-demon question
  2011-01-04 16:56               ` Tassilo Horn
@ 2011-01-04 18:02                 ` Adam Sjøgren
  2011-01-06 17:12                   ` Philipp Haselwarter
  0 siblings, 1 reply; 17+ messages in thread
From: Adam Sjøgren @ 2011-01-04 18:02 UTC (permalink / raw)
  To: ding

On Tue, 04 Jan 2011 17:56:53 +0100, Tassilo wrote:

> asjo@koldfront.dk (Adam Sjøgren) writes:

>>> (plus I don't bother with gnus-demon-init)

>> That isn't necessary?

> No, `gnus-demon-add-handler' calls it for you.  Calling it explicitly
> again will cancel all timers and initialize them anew for a second
> time. :-)

I wonder why I have it in my configuration then. Oh well... Maybe it was
to have delayed mail sent, from before I used the demon to look for new
mail? Probably I am just making things up by now.


  :-),

   Adam

-- 
 "Accept the mystery!"                                        Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: gnus-demon question
  2011-01-04 18:02                 ` Adam Sjøgren
@ 2011-01-06 17:12                   ` Philipp Haselwarter
  2011-01-09 14:28                     ` Noorul Islam
  0 siblings, 1 reply; 17+ messages in thread
From: Philipp Haselwarter @ 2011-01-06 17:12 UTC (permalink / raw)
  To: ding

The problem I encountered with the demon is that `gnus-demon-init'
(which gets called at the end of `gnus-demon-add-handler' btw) has to be
called at a certain point of time (after gnus is launched?).
As I split up my gnus config to have only personal information in my
.gnus.el and keep the other stuff, like adding the handlers, elsewhere,
I used (eval-after-load "gnus" 'load-my-gnus-config) which apparently
resulted in `gnus-demon-init' being run at some suboptimal time.

Long story short, this reliably made the demon work for me:

--8<---------------cut here---------------start------------->8---
(add-hook 'gnus-started-hook 'gnus-demon-init)
--8<---------------cut here---------------end--------------->8---

Also, I use different handlers to get news by group-level; I poll my
imap server way more often than gmane. I can post the setup if anyone's
interested.


-- 
Philipp Haselwarter




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

* Re: gnus-demon question
  2011-01-06 17:12                   ` Philipp Haselwarter
@ 2011-01-09 14:28                     ` Noorul Islam
  0 siblings, 0 replies; 17+ messages in thread
From: Noorul Islam @ 2011-01-09 14:28 UTC (permalink / raw)
  To: Philipp Haselwarter; +Cc: ding

On Thursday, January 6, 2011, Philipp Haselwarter  wrote:
> The problem I encountered with the demon is that `gnus-demon-init'
> (which gets called at the end of `gnus-demon-add-handler' btw) has to be
> called at a certain point of time (after gnus is launched?).
> As I split up my gnus config to have only personal information in my
> .gnus.el and keep the other stuff, like adding the handlers, elsewhere,
> I used (eval-after-load "gnus" 'load-my-gnus-config) which apparently
> resulted in `gnus-demon-init' being run at some suboptimal time.
>
> Long story short, this reliably made the demon work for me:
>
> --8<---------------cut here---------------start------------->8---
> (add-hook 'gnus-started-hook 'gnus-demon-init)
> --8<---------------cut here---------------end--------------->8---
>
> Also, I use different handlers to get news by group-level; I poll my
> imap server way more often than gmane. I can post the setup if anyone's
> interested.
>

Yes, I would like to take a look.

-Noorul



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

end of thread, other threads:[~2011-01-09 14:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-22  6:47 gnus-demon question Noorul Islam K M
2010-12-22  7:49 ` Tassilo Horn
2010-12-22  8:49   ` Noorul Islam K M
2011-01-03 11:58 ` Noorul Islam K M
2011-01-04  0:02 ` Lars Magne Ingebrigtsen
2011-01-04  5:58   ` Noorul Islam K M
2011-01-04 11:34     ` Adam Sjøgren
2011-01-04 12:06       ` Noorul Islam K M
2011-01-04 12:56         ` Adam Sjøgren
2011-01-04 13:13           ` Robert Pluim
2011-01-04 14:22             ` Adam Sjøgren
2011-01-04 14:47               ` Adam Sjøgren
2011-01-04 16:56               ` Tassilo Horn
2011-01-04 18:02                 ` Adam Sjøgren
2011-01-06 17:12                   ` Philipp Haselwarter
2011-01-09 14:28                     ` Noorul Islam
2011-01-04  7:54   ` Tassilo Horn

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