Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Richmond <dnomhcir@gmx.com>
Cc: info-gnus-english@gnu.org
Subject: Re: Idle Time to Poll Serve
Date: Thu, 20 Feb 2020 08:41:36 -0800	[thread overview]
Message-ID: <878skx8b3z.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <21295.3531461366$1582207560@news.gmane.org> (Richmond's message of "Thu, 20 Feb 2020 14:05:40 +0000")

Richmond <dnomhcir@gmx.com> 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.

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

  reply	other threads:[~2020-02-20 16:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 14:05 Richmond
2020-02-20 16:41 ` Eric Abrahamsen [this message]
2020-02-20 16:52   ` Richmond
2020-02-20 17:15   ` Richmond
2020-02-20 17:44     ` Eric Abrahamsen
2020-02-20 18:25     ` Adam Sjøgren via info-gnus-english
2020-02-20 22:02       ` Richmond
2020-02-21  7:35         ` Adam Sjøgren via info-gnus-english

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878skx8b3z.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=dnomhcir@gmx.com \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).