all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: unwind-protect and inhibit-quit
Date: Sat, 17 Jul 2021 09:20:41 +0300	[thread overview]
Message-ID: <83sg0d4g1y.fsf@gnu.org> (raw)
In-Reply-To: <8735seosjs.fsf@sperrhaken.name> (message from Felix Dietrich on Fri, 16 Jul 2021 23:30:31 +0200)

> From: Felix Dietrich <felix.dietrich@sperrhaken.name>
> Date: Fri, 16 Jul 2021 23:30:31 +0200
> 
> But at which point is the ‘quit-flag’ actually handled?

When the C-level code of the Lisp machine thinks it's a good time to
do that.  In general, whenever the Lisp evaluation is entered,
whenever a Lisp function is called, and inside any loops that might
run for a long time or might not exit.  There's no magic with handling
quit on the C level, it mast be invoked explicitly.

> The macro ‘with-local-quit’ states that the “quit-flag” “will not be
> handled until the next function call”[1].  Could, therefore, a
> careful and cooperative “ftp-setup-buffer” ensure that the process
> is either cleaned-up or returned?

There's no way to ensure atomicity on the Lisp level, because a Lisp
program has no real control of when quit handling happens.  Only
primitives can do that (and actually do that where we think it's
necessary).

> I am thinking of something like the following:

What problem(s) this is intended to fix/handle?



  parent reply	other threads:[~2021-07-17  6:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 15:14 unwind-protect and inhibit-quit Felix Dietrich
2021-07-16  7:18 ` Eli Zaretskii
2021-07-16  8:10   ` Thibaut Verron
2021-07-16 11:19     ` Eli Zaretskii
2021-07-16 14:46       ` Felix Dietrich
2021-07-16 14:56         ` Felix Dietrich
2021-07-16 15:00     ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-16 20:01       ` Thibaut Verron
2021-07-16 20:06         ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-16 21:30       ` Felix Dietrich
2021-07-16 21:37         ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-17 11:52           ` Felix Dietrich
2021-07-17  6:20         ` Eli Zaretskii [this message]
2021-07-17 15:46           ` Felix Dietrich
2021-07-17 16:34             ` Eli Zaretskii

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=83sg0d4g1y.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@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.