emacs-devel
[Top][All Lists]
Advanced

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

Re: run-with-timer vs run-with-idle-timer


From: João Távora
Subject: Re: run-with-timer vs run-with-idle-timer
Date: Fri, 11 May 2018 12:05:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

João Távora <address@hidden> writes:

> Thien-Thi Nguyen <address@hidden> 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 via email to

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