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: Richard Stallman
Subject: Re: save-excursion and multi-thread?
Date: Tue, 28 Sep 2021 19:33:37 -0400

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > The current concurrent behavior of save-excursion
  > makes it basically useless with threads in any sense.

I think save-excursion in one thread ought to keep its locally-bound
point and mark within that thread alone.  In other words, it should
work like dynamic variable bindings.

So if a thread does not do save-excursion, it should share the value
of point in each buffer with the other threads.  However, doing
save-excursion in a buffer should "locally bind" point (and mark) in
that buffer in the current thread, and that "local binding" should not
affect other threads or be affected by them.

This does not necessarily require changing the way point is
implemented at low level.  Indeed, I would prefer to avoid such
far-reaching changes if I were implementing it.  It's enough to
make it possible for thread-switching to understand save-excursion
and DTRT.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

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