From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: unwind-protect within while-no-input Date: Wed, 08 May 2024 17:18:19 +0300 Message-ID: <8634qs9yl0.fsf@gnu.org> References: <86msp1a24a.fsf@gnu.org> <86jzk4a5ck.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29036"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 08 16:19:13 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s4i8U-0007S7-Q8 for ged-emacs-devel@m.gmane-mx.org; Wed, 08 May 2024 16:19:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4i7m-0005LI-Cm; Wed, 08 May 2024 10:18:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4i7i-0005Kl-6r for emacs-devel@gnu.org; Wed, 08 May 2024 10:18:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4i7h-0005Pd-J4; Wed, 08 May 2024 10:18:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0AQG6/h27t3nvK5lMymKEguCmDRnCGkGuLAp8LMRTsM=; b=V7U73cVA8tIB Jhd5v1grJGBja3oN2o1HMb41WQG2QzYx2p3Qo83aexqE20BDiFLtj8rjyTZawgQAlScB2QC4PHE4v 8vt2IPBkfH1QeYcwZSbum2p9E58cCwe74C7+NQieZgPIJilKfuM2Uu3AXkMx63vxQjIxeIjRf9jgw lssjxoyAJhGtCl0hGjnwbTrP1wG58qqWQV88d1Zs+6ZbTRdHa125QH4DoEHAOlDG8Zi4E7Wup4K4m Tt/1HmZb1coAhz6RG5xzitOWki7kSZKnOptcldpI9ZPHSjhaG71wlf0Zm4KJ4jgwK1Li+hVdivLVp AgyYJXZHJ1TZ3Pm+6lg50A==; In-Reply-To: (message from Spencer Baugh on Wed, 08 May 2024 09:57:44 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319009 Archived-At: > From: Spencer Baugh > Date: Wed, 08 May 2024 09:57:44 -0400 > > 1. The unwind forms should run if there is a quit, no matter what > triggered the quit. > > 2. One thing that might trigger a quit is a while-no-input form outside > my code. > > 3. Therefore, the unwind forms should be run even when while-no-input > triggers the quit. You keep changing the conditions with each solution that people propose. What is the purpose of this "salami-like" way of discussing an issue? Why not state the conditions for the solution you seek once, and state them completely, and then let people waste less time on trying to help you? > Your code does not run the unwind forms when run inside a > while-no-input. Why should it? When while-no-input is interrupted by input, it conceptually is not "quitting"; the fact that it uses quit-flag is an internal implementation detail. If you want the unwind forms to run when while-no-input is interrupted by input, simply do it: while-no-input provides a clear documented indication that it was interrupted by input, and you can use that to decide whether to run the unwind forms in that case.