emacs-devel
[Top][All Lists]
Advanced

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

Re: save-excursion and multi-thread?


From: Stefan Monnier
Subject: Re: save-excursion and multi-thread?
Date: Mon, 27 Sep 2021 15:35:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Is this how save-excursion supposed to work?

Good question.

> It’s inconsistent with the behavior of special variable + dynamic bindings,
> which works currently under multi-thread.

You might be right and maybe we should undo/redo such buffer movements when
context-switching, just like we do for the let bindings.

We already implement such undo/redo of this and similar forms in
a different yet related context: when we evaluate a user-specified
expression in a given stack frame (from the *Backtrace* debugger).
See `backtrace-eval`.

This said, your scenario smells like a race-condition to me, so maybe we
should instead "lock" the buffer's point while we're inside the
`save-excursion`.


        Stefan




reply via email to

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