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: Qiantan Hong
Subject: Re: save-excursion and multi-thread?
Date: Sun, 26 Sep 2021 19:21:38 +0000

>>> The Lisp threads in Emacs were not designed to support several threads
>>> making changes to the same buffer.  On the contrary, the assumption
>>> was that each thread will have its own current buffer, which is why
>>> the current buffer is thread-local -- it can be different in each
>>> thread.
>> I see. Can I fake that with indirect-buffer?
> 
> For moving point, I think you can.  But if you change the text, you
> will see the changes in the other threads as well.
That’s intended. 
I simply want point to behave like a proper global variable
and save-excursion to behave like a proper let-binding.
In that sense I don’t want point to be thread local, 
I want save-excursion to be thread local, which I think
is the only sensible concurrent semantics for save-excursion.
Only in that way save-excursion really serves its intended purpose
— to have “local” excursion that doesn’t affect global state
outside the code it surrounds.
Does that convince you?

reply via email to

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