[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unwind-protect and inhibit-quit

From: Eli Zaretskii
Subject: Re: unwind-protect and inhibit-quit
Date: Sat, 17 Jul 2021 09:20:41 +0300

> From: Felix Dietrich <>
> 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

> I am thinking of something like the following:

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]