all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>, ttn@gnu.org
Subject: Re: run-with-timer vs run-with-idle-timer
Date: Fri, 11 May 2018 12:05:48 +0100	[thread overview]
Message-ID: <87k1sapi43.fsf@gmail.com> (raw)
In-Reply-To: <871seiqxwr.fsf@gmail.com> ("João Távora"'s message of "Fri, 11 May 2018 11:39:16 +0100")

João Távora <joaotavora@gmail.com> writes:

> Thien-Thi Nguyen <ttn@gnu.org> writes:
>
>> If you can structure whatever ‘catch’es the ‘throw’s to mutate
>> state visible to CONDITION, then you can use ‘while CONDITION’.
>> If that state is dynamic (e.g., declared w/ ‘defvar’), you can
>> can reconfigure the ‘throw’ to simply mutate it directly, and
>> eliminate the ‘catch’ part (and still use ‘while CONDITION’).
>
> After thinking a bit about it, you're totally right, and it becomes much
> simpler (read below).

> I suppose it's a matter of style.

Just to clarify, since I've just realised we're talking about two
independent things here:

1. "catch/loop/throw" vs "let/test/loop/set" is indeed a matter of style
   (but you've probably convinced me to prefer the latter).
   
2. It's the short timeout to accept-process-output that I'm supposing
   hurts performance, but it can also be lengthened using the first
   idiom. I just blindly accepted what slime.el was doing since around
   2004. I dug a bit of history (thanks M-x vc-region-history!) and a
   10sec timeout first appeared to replace a timeoutless call. Two years
   later it was (apparently buggily) replaced by a 0.01 second timeout
   when adapting for the new accept-process-output in Emacs 22. That
   value has stuck until today, probably because it works OK, too.

João



  reply	other threads:[~2018-05-11 11:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 17:34 run-with-timer vs run-with-idle-timer João Távora
2018-05-09 18:10 ` Eli Zaretskii
2018-05-09 18:17 ` Eli Zaretskii
2018-05-09 18:40   ` João Távora
2018-05-09 18:59     ` Eli Zaretskii
2018-05-09 19:15       ` João Távora
2018-05-09 19:21         ` Eli Zaretskii
2018-05-09 19:34           ` João Távora
2018-05-09 20:00         ` Davis Herring
2018-05-09 20:18           ` João Távora
2018-05-10 11:46 ` Thien-Thi Nguyen
2018-05-10 12:28   ` João Távora
2018-05-10 18:50     ` Thien-Thi Nguyen
2018-05-11 10:39       ` João Távora
2018-05-11 11:05         ` João Távora [this message]
2018-05-12 17:57           ` Thien-Thi Nguyen
2018-05-12 17:37         ` Thien-Thi Nguyen

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=87k1sapi43.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=ttn@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.