From: Spencer Baugh <sbaugh@janestreet.com>
To: emacs-devel@gnu.org
Subject: Re: unwind-protect within while-no-input
Date: Wed, 08 May 2024 10:38:11 -0400 [thread overview]
Message-ID: <ierle4kqsh8.fsf@janestreet.com> (raw)
In-Reply-To: 8634qs9yl0.fsf@gnu.org
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Spencer Baugh <sbaugh@janestreet.com>
>> 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?
Sorry, it's not intentional - from my perspective I've been asking for
the same thing each time, with all the same details. But clearly I have
been not fully communicating what I mean.
>> 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.
Because there might be something I want to clean up.
For example, my code might create a process or temporary directory which
should be deleted even if interrupted by input.
> 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.
What concretely are you suggesting? Could you give an example in code?
Note that my code doesn't require while-no-input or always run inside
while-no-input - it's just that whenever my code happens to be inside a
while-no-input, my code should still do the cleanup.
next prev parent reply other threads:[~2024-05-08 14:38 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 12:45 unwind-protect within while-no-input Spencer Baugh
2024-05-07 18:05 ` Spencer Baugh
2024-05-07 18:49 ` Eli Zaretskii
2024-05-07 19:43 ` Spencer Baugh
2024-05-08 3:59 ` Po Lu
2024-05-08 11:42 ` Michael Heerdegen via Emacs development discussions.
2024-05-08 11:47 ` Michael Heerdegen via Emacs development discussions.
2024-05-08 13:44 ` Spencer Baugh
2024-05-08 16:13 ` Michael Heerdegen via Emacs development discussions.
2024-05-08 17:18 ` Spencer Baugh
2024-05-08 20:43 ` Michael Heerdegen via Emacs development discussions.
2024-05-09 12:57 ` Spencer Baugh
2024-05-09 14:13 ` Michael Heerdegen via Emacs development discussions.
2024-05-08 12:12 ` Eli Zaretskii
2024-05-08 12:36 ` Michael Heerdegen via Emacs development discussions.
2024-05-08 11:52 ` Eli Zaretskii
2024-05-08 13:57 ` Spencer Baugh
2024-05-08 14:18 ` Eli Zaretskii
2024-05-08 14:38 ` Spencer Baugh [this message]
2024-05-08 15:06 ` Eli Zaretskii
2024-05-08 15:14 ` Spencer Baugh
2024-05-08 18:51 ` Eli Zaretskii
2024-05-08 19:28 ` Spencer Baugh
2024-05-09 5:46 ` Eli Zaretskii
2024-05-09 13:07 ` Spencer Baugh
2024-05-09 17:41 ` Dmitry Gutov
2024-05-11 9:48 ` Eli Zaretskii
2024-05-11 10:37 ` Eshel Yaron
2024-05-11 10:42 ` Zhengyi Fu
2024-05-11 21:45 ` Dmitry Gutov
2024-05-11 22:08 ` Daniel Mendler via Emacs development discussions.
2024-05-12 1:59 ` Dmitry Gutov
2024-05-12 8:50 ` Daniel Mendler via Emacs development discussions.
2024-05-12 11:49 ` Dmitry Gutov
2024-05-14 21:30 ` Dmitry Gutov
2024-05-26 2:49 ` Stefan Monnier via Emacs development discussions.
2024-05-26 15:36 ` Dmitry Gutov
2024-05-26 18:00 ` Stefan Monnier
2024-05-26 22:56 ` Dmitry Gutov
2024-05-29 0:39 ` Stefan Monnier
2024-05-29 1:17 ` Dmitry Gutov
2024-05-08 20:34 ` Michael Heerdegen via Emacs development discussions.
2024-05-08 16:17 ` Michael Heerdegen via Emacs development discussions.
2024-05-26 2:47 ` Stefan Monnier via Emacs development discussions.
2024-05-26 4:36 ` Stefan Monnier
2024-05-26 4:55 ` Eli Zaretskii
2024-05-26 18:12 ` Stefan Monnier
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=ierle4kqsh8.fsf@janestreet.com \
--to=sbaugh@janestreet.com \
--cc=emacs-devel@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.