From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: run-with-timer vs run-with-idle-timer Date: Fri, 11 May 2018 12:05:48 +0100 Message-ID: <87k1sapi43.fsf@gmail.com> References: <87tvrgd972.fsf@gmail.com> <87a7t74tsf.fsf@gnuvola.org> <87603v4a5x.fsf@gnuvola.org> <871seiqxwr.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1526036686 29359 195.159.176.226 (11 May 2018 11:04:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 May 2018 11:04:46 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel , ttn@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 11 13:04:41 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fH5qr-0007WN-Eo for ged-emacs-devel@m.gmane.org; Fri, 11 May 2018 13:04:41 +0200 Original-Received: from localhost ([::1]:38202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fH5sw-0000Hj-NW for ged-emacs-devel@m.gmane.org; Fri, 11 May 2018 07:06:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fH5sH-0000Hc-Tx for emacs-devel@gnu.org; Fri, 11 May 2018 07:06:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fH5sD-0003Ky-VH for emacs-devel@gnu.org; Fri, 11 May 2018 07:06:09 -0400 Original-Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:51912) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fH5s8-0003Ee-9k; Fri, 11 May 2018 07:06:00 -0400 Original-Received: by mail-wm0-x22f.google.com with SMTP id j4-v6so2123290wme.1; Fri, 11 May 2018 04:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-transfer-encoding; bh=x92uJxiF8i4EIJ2crPGXFRb+1emdZBt6tr1uPT460cg=; b=jlYwsZ4Dc5W6s8sJLxaUCpk0LZllrjC9ZEaZ6lBm1X8CaYBNsJ+f35Mn46AHmAFvzC AMt0VRY6vIsXaCTNWoBEjGCr6evhF4g/fTyTyS8nj1ivcu58X+H2s6EMxg989tNImpIN XAg6yzalAmJtmjWw1cBHCnsc1nuvCVb/QddPljEZuSgzV5Cx56ejZ0Q2u7lsPcz/huai Tkeqlwjb1IG4SGBTV+TMvKcsyBCA31SD0MRZr00d38CYSl8s7TMo5rsgpfBuBbfvoiKM blq3qSfz091q5cyh/wySvAhSeOzIYyQEjqdfStorCPw0NA9eajr1waAVOa+Tlb4RUDJL T9KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=x92uJxiF8i4EIJ2crPGXFRb+1emdZBt6tr1uPT460cg=; b=s0m4za2bMwpDY9lhiSoMprshdsH1fDGlINfzHLAOsUc7EtPybFiQ6SgAd0TNrmciwI oyrOEGb8wbH2smHG6PXcZHUuR6VB3frpKPI783AOscmfBYt+wC0USgQJDrnvg4ooQtno QnV7/5MNZ/jk3lR5uzq3/NZQvpDVpCnBXma0/cx0Bglinz5IbVCRpV0nhRYtCDweeRGg sqVbRmGiLPd8eatnhRICtTic/lRh7VisxkNaYZbbHA9lRSsZdXidZeFMb8lT9Za45OI4 z/4cZJG7pJ3L4UKbNOTTEKXo6/yt8Cd6VIGK/Jh/nVX7RpC+eyZhgX6XUSy3nDwjBSSj 3+YA== X-Gm-Message-State: ALKqPwc7DEHKlrfDVhjRsknlJDSlEo4EeTu7DMOKhAMYsu9sRTAI8GzW tm7eimze0tEhg6DfhRXiTSB1n0Ot X-Google-Smtp-Source: AB8JxZoSYSDlhIcR7exbV4q6S2vTF/jvoxuDm3wrtPYld5MmMpXTU7UA1Ltn+VEDPgiJCrQT9PFzXw== X-Received: by 2002:a1c:e006:: with SMTP id x6-v6mr1534223wmg.80.1526036758711; Fri, 11 May 2018 04:05:58 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id m35-v6sm3037461wrm.51.2018.05.11.04.05.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 May 2018 04:05:57 -0700 (PDT) In-Reply-To: <871seiqxwr.fsf@gmail.com> (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?= =?utf-8?Q?a=22's?= message of "Fri, 11 May 2018 11:39:16 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225227 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > Thien-Thi Nguyen writes: > >> If you can structure whatever =E2=80=98catch=E2=80=99es the =E2=80=98thr= ow=E2=80=99s to mutate >> state visible to CONDITION, then you can use =E2=80=98while CONDITION=E2= =80=99. >> If that state is dynamic (e.g., declared w/ =E2=80=98defvar=E2=80=99), y= ou can >> can reconfigure the =E2=80=98throw=E2=80=99 to simply mutate it directly= , and >> eliminate the =E2=80=98catch=E2=80=99 part (and still use =E2=80=98while= CONDITION=E2=80=99). > > 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). =20=20=20 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=C3=A3o