From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix Dietrich Newsgroups: gmane.emacs.help Subject: Re: unwind-protect and inhibit-quit Date: Fri, 16 Jul 2021 16:46:27 +0200 Message-ID: <87sg0epb98.fsf@sperrhaken.name> References: <875yxbr4lr.fsf@sperrhaken.name> <83eeby680s.fsf@gnu.org> <83bl725wvs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6470"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 16 16:47:08 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1m4P7M-0001QO-F6 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 16 Jul 2021 16:47:08 +0200 Original-Received: from localhost ([::1]:54368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4P7L-0001vU-6C for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 16 Jul 2021 10:47:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4P6s-0001vG-Cs for help-gnu-emacs@gnu.org; Fri, 16 Jul 2021 10:46:38 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.74]:38173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4P6p-0001F7-OR for help-gnu-emacs@gnu.org; Fri, 16 Jul 2021 10:46:38 -0400 Original-Received: from localhost ([77.11.230.244]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MWAWq-1lcQmB0MTS-00XeMK for ; Fri, 16 Jul 2021 16:46:33 +0200 In-Reply-To: <83bl725wvs.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 16 Jul 2021 14:19:35 +0300") X-Provags-ID: V03:K1:m6pzpUN4h9cEWYwIuDM2UmzFaQogvu+7CItDZgPjCkUHe9j/glW fw8T4k4YzFOe8/yIUVkG9FgHD+Q6t/bjgdMMKIYqBYuW20rozWENI1hDW7pxGOIzjeLY5+g FQFXhnaOhXvDyhoB80SmvLrK+N8YZDvNUgshoQcIJfb3Oy590AF5/nHhTFLWqFPMEvz7Gdg HAzr0+BEifPMVXPXc8qTw== X-UI-Out-Filterresults: notjunk:1;V03:K0:jt/g3uHzmww=:Zfc4S1ZNGjuIyLQzcixNrt pJCOhyBZdM2um2mTHSXU0pCkxqdmNpLZeiEMASKsyKKfPvmuFFK91GpzGfd3SS3qjGGJUhdIO 4hG3FApdZGoOezvs0+mnRU6p0JURXjHfDH1z9UZq3eP4t2Djtn4vPZa+XiL5ynLS1Bfr4nuCq q4uYcWyX5ylPWWuaGpo37HYiHFXmV3S3w+ZSZYz4n962pVCYWudCV9rrZ8K4+8w1FXh78CZYY Q0Pa/aC/Je0/Q5FVZhPQ6oZIJ6lbnk748oVUArseH1c6LiUWWlp7lu422vpjS2CP2o2Oa/l9F TRMO09t74yCrU4Qwce4N7ImA6RVCsXVg6C9ZNPUZlcvQccYQRWIZdrXEa85Qt6tnbPEX3dCbO g0q0aMJFnwxd0c7mO4RGbawRMRfMrUOyLVVa3qdzmJzJZ4D1M2IwkT5Ikze13/DSu+TJoJhdx UFdPx+1rQ8ndXlPFr1nzX3SQ/GQp7nW8nmd0Yv3ZW2A/cjP2C/isWJIf/FqdxGbd0lD3OkNaz kQN5E/USlOXVmbxHIV1eLPRSOA8NbQHjQt8zX9na6oByIFt7RQ0+zrnYJEZam4fP90d5MhJdN jK2vzeLyzKmLXcLKAmIuGaVzB0viLlHwf55HioAwsJ82r5ifcdKyoc4RWNjcOieqPxUj9H9ZM yOB384Sz9YE9i56cvs65N7tZr15bGLHIInYK0+jhpRT2DZNHhMKaCMqUP1dvMMlad1bG26i1y hjNFhUFd9XCLK8ItXszJxV7uEIOxojPzSpvJYMtUCiySBeGh1a+PMTQWw3lt15nIwcHJhyXd Received-SPF: none client-ip=217.72.192.74; envelope-from=felix.dietrich@sperrhaken.name; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131752 Archived-At: Eli Zaretskii writes: >> From: Thibaut Verron >> Date: Fri, 16 Jul 2021 10:10:36 +0200 >> Cc: help-gnu-emacs >>=20 >> > You could use inhibit-quit, but that is generally a bad idea from the >> > UI point of view, when invoking potentially long-running functions: >> > you are preventing the user from interrupting that long function. For >> > example, suppose the FTP command stalls for some reason. >> > >>=20 >> Now I'm curious too... Would something like this work? >>=20 >> (let ((inhibit-quit t)) >> (setq process >> (let ((inhibit-quit nil)) >> (ftp-setup-buffer host file)))) > > It might, but I still suggest to bind inhibit-quit non-nil only for > short durations of time and as little as possible. There be dragons. I just found the =E2=80=9Cwith-local-quit=E2=80=9D macro. It=CA=BCs commen= t says that the quit-flag =E2=80=9Cwill not be handled until the next function call=E2=80= =9D. Doesn=CA=BCt that imply that once the let form has a value to return, the assignment should go through? Admittingly, this is a lot of guessing on my side, as I do not know Emacs internals. Also: isn=CA=BCt your advice =E2=80=9Cto bind inhibit-quit non-nil only for= short durations=E2=80=9D heeded in Thibaut=CA=BCs suggestions? It is non-nil mor= e or less only for the assignment (and a bit for the setup of the let form). --=20 Felix Dietrich