Gnus development mailing list
 help / color / mirror / Atom feed
* issue of gnus daemon
@ 2010-12-03  8:23 Binjo
  2010-12-03 10:05 ` Julien Danjou
  0 siblings, 1 reply; 7+ messages in thread
From: Binjo @ 2010-12-03  8:23 UTC (permalink / raw)
  To: Gnus

hi,

i use gnus demon to retrieve mail, and my settings as follows:

#v+
    ;; idle 2 minutes, then check news every 3 minutes.
    (gnus-demon-add-handler 'binjo-gnus-group-get-new-news 3 2)
#v-

it turns out the recent changes do not obey what the info said.

M-: (info "(gnus) Daemons")

#v+
   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.
#v-

wheras from the *imap log* buffer, i can confirm it runs
`gnus-demon-run-callback' exactly every 3 mins, no matter emacs is idle or
not. that's weird.

09:39:00 202 UID FETCH 1:* FLAGS
09:39:00 203 EXAMINE "Dropbox"
...
09:42:00 272 UID FETCH 1:* FLAGS
09:42:00 273 EXAMINE "Dropbox"
...
09:45:00 342 UID FETCH 1:* FLAGS
09:45:00 343 EXAMINE "Dropbox"
...

i'm not able to figure out where's the problem though :<

the following patch resolve issue when using such daemon handler anyway:
(gnus-demon-add-handler 'binjo-gnus-group-get-new-news nil 2)

diff --git a/lisp/gnus-demon.el b/lisp/gnus-demon.el
index 94a4952..c146b4f 100644
--- a/lisp/gnus-demon.el
+++ b/lisp/gnus-demon.el
@@ -121,7 +121,8 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
            ;; If t, replace by 1
            (time (cond ((eq time t)
                         gnus-demon-timestep)
-                       ((null time))
+                       ((null time)
+                        nil)
                        (t (* time gnus-demon-timestep))))
            (timer
             (cond

regards,

-- 
Life is like a prison, can you break it?



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

* Re: issue of gnus daemon
  2010-12-03  8:23 issue of gnus daemon Binjo
@ 2010-12-03 10:05 ` Julien Danjou
  2010-12-03 12:20   ` Binjo
  0 siblings, 1 reply; 7+ messages in thread
From: Julien Danjou @ 2010-12-03 10:05 UTC (permalink / raw)
  To: Binjo; +Cc: Gnus

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

On Fri, Dec 03 2010, Binjo wrote:

> wheras from the *imap log* buffer, i can confirm it runs
> `gnus-demon-run-callback' exactly every 3 mins, no matter emacs is idle or
> not. that's weird.

What's the returned value of (gnus-demon-idle-since)?
It should be 0.0.

Which Emacs are you using?

> the following patch resolve issue when using such daemon handler anyway:
> (gnus-demon-add-handler 'binjo-gnus-group-get-new-news nil 2)

Pushed, thanks!

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: issue of gnus daemon
  2010-12-03 10:05 ` Julien Danjou
@ 2010-12-03 12:20   ` Binjo
  2010-12-03 14:27     ` Julien Danjou
  0 siblings, 1 reply; 7+ messages in thread
From: Binjo @ 2010-12-03 12:20 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Gnus

Julien Danjou <julien@danjou.info> writes:

> On Fri, Dec 03 2010, Binjo wrote:
>
>> wheras from the *imap log* buffer, i can confirm it runs
>> `gnus-demon-run-callback' exactly every 3 mins, no matter emacs is idle or
>> not. that's weird.
>
> What's the returned value of (gnus-demon-idle-since)?
> It should be 0.0.

yes. i can't check this return value while typing though... the demon routine
still being called while i was typing in other buffers.

>
> Which Emacs are you using?
>

GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2010-10-22 on IQ1SPU8

>> the following patch resolve issue when using such daemon handler anyway:
>> (gnus-demon-add-handler 'binjo-gnus-group-get-new-news nil 2)
>
> Pushed, thanks!

confirmed, thanks

-- 
Life is like a prison, can you break it?



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

* Re: issue of gnus daemon
  2010-12-03 12:20   ` Binjo
@ 2010-12-03 14:27     ` Julien Danjou
  2010-12-04  5:46       ` Binjo
  0 siblings, 1 reply; 7+ messages in thread
From: Julien Danjou @ 2010-12-03 14:27 UTC (permalink / raw)
  To: Binjo; +Cc: Gnus

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

On Fri, Dec 03 2010, Binjo wrote:
> yes. i can't check this return value while typing though... the demon routine
> still being called while i was typing in other buffers.

I do not understand how it's possile. :)

Can you C-h v timer-list and paste me the entry containing
gnus-demon-run-callback?

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: issue of gnus daemon
  2010-12-03 14:27     ` Julien Danjou
@ 2010-12-04  5:46       ` Binjo
  2010-12-06 11:03         ` Julien Danjou
  0 siblings, 1 reply; 7+ messages in thread
From: Binjo @ 2010-12-04  5:46 UTC (permalink / raw)
  To: Julien Danjou; +Cc: ding

hi, julien

Julien Danjou <julien@danjou.info> writes:

> On Fri, Dec 03 2010, Binjo wrote:
>> yes. i can't check this return value while typing though... the demon routine
>> still being called while i was typing in other buffers.
>
> I do not understand how it's possile. :)
>
> Can you C-h v timer-list and paste me the entry containing
> gnus-demon-run-callback?

,----[ C-h v timer-list RET ]
| timer-list is a variable defined in `C source code'.
| Its value is shown below.
| 
| Documentation:
| List of active absolute time timers in order of increasing time.
| 
| Value: 
| ([nil 19705 54409 796000 17 twittering-redisplay-status-on-buffer nil nil]
|  [nil 19705 54413 796000 90 twittering-timer-action
|       (twittering-update-active-buffers)
|       nil]
|  [nil 19705 54440 0 180 gnus-demon-run-callback
|       (binjo-gnus-group-get-new-news 2)
|       nil]
|  [nil 19705 55032 93000 900 nnimap-keepalive nil nil]
|  [nil 19705 57027 609000 3600 url-cookie-write-file nil nil])
| 
| [back]
`----

thanks for your patient.

have a nice weekend ;-p

-- 
Life is like a prison, can you break it?



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

* Re: issue of gnus daemon
  2010-12-04  5:46       ` Binjo
@ 2010-12-06 11:03         ` Julien Danjou
  2010-12-07  5:51           ` Binjo
  0 siblings, 1 reply; 7+ messages in thread
From: Julien Danjou @ 2010-12-06 11:03 UTC (permalink / raw)
  To: Binjo; +Cc: ding

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

On Sat, Dec 04 2010, Binjo wrote:

> |  [nil 19705 54440 0 180 gnus-demon-run-callback
> |       (binjo-gnus-group-get-new-news 2)
> |       nil]

gnus-demon-run-callback executes binjo-gnus-group-get-new-news with the
condition:

    (when (or (not idle)
              (<= idle (gnus-demon-idle-since)))

But `idle' is 2 in your case, and since (gnus-demon-idle-since)
returns 0, I do not see what can be wrong. :(

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: issue of gnus daemon
  2010-12-06 11:03         ` Julien Danjou
@ 2010-12-07  5:51           ` Binjo
  0 siblings, 0 replies; 7+ messages in thread
From: Binjo @ 2010-12-07  5:51 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Gnus

Julien Danjou <julien@danjou.info> writes:

> On Sat, Dec 04 2010, Binjo wrote:
>
>> |  [nil 19705 54440 0 180 gnus-demon-run-callback
>> |       (binjo-gnus-group-get-new-news 2)
>> |       nil]
>
> gnus-demon-run-callback executes binjo-gnus-group-get-new-news with the
> condition:
>
>     (when (or (not idle)
>               (<= idle (gnus-demon-idle-since)))
>
> But `idle' is 2 in your case, and since (gnus-demon-idle-since)
> returns 0, I do not see what can be wrong. :(

yeah, it's weird.. i just tried to set `debug-on-entry' of
gnus-demon-run-callback, and check (gnus-demon-idle-since), but still can't
figure out what's wrong here. :-(

i may have to adopt "(gnus-demon-add-handler 'foo nil 2)" now.

thanks for your time.
-- 
Life is like a prison, can you break it?



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

end of thread, other threads:[~2010-12-07  5:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03  8:23 issue of gnus daemon Binjo
2010-12-03 10:05 ` Julien Danjou
2010-12-03 12:20   ` Binjo
2010-12-03 14:27     ` Julien Danjou
2010-12-04  5:46       ` Binjo
2010-12-06 11:03         ` Julien Danjou
2010-12-07  5:51           ` Binjo

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