[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Idle Time to Poll Serve

From: Richmond
Subject: Re: Idle Time to Poll Serve
Date: Thu, 20 Feb 2020 16:52:42 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.60 (gnu/linux)

Eric Abrahamsen <> writes:

> Richmond <> writes:
>> I have devised this script to set up idle timers to poll the news
>> server. But it seems to cause emacs to hang after a while. If I use gtk
>> I can get it to respond with ctrl-g, but running in a terminal,
>> i.e. konsole or lxterminal, it is more difficult. What's wrong? This is
>> placed in .gnus
>> (defun news-check ()
>>   (ignore-errors
>>     (gnus-group-get-new-news)
>>     )
>>   (setq result (run-with-idle-timer (time-add (current-idle-time) 300) t 
>> (lambda () (news-check))))
>>   )
> Why is this function recursive? That's bound to be a bad idea. I would
> refactor to remove the recursion, and to only start another check after
> the last one has completed.

I don't know how that would be possible. Once the news-check script has
completed, it has no power to do anything, so it would not be able to
set up another idle timer.

The script has to finish, otherwise emacs would be unavailable to
use. So it has to prepare the next run before it finishes. Unless I set
up many idle timers in advance, say enough to last 24 hours?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]