[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: save-excursion and multi-thread?
From: |
Eli Zaretskii |
Subject: |
Re: save-excursion and multi-thread? |
Date: |
Sun, 26 Sep 2021 22:29:12 +0300 |
> From: Qiantan Hong <qhong@mit.edu>
> CC: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Sun, 26 Sep 2021 19:21:38 +0000
>
> >> 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
But point is not a variable. It's a property of a buffer, and all you
have is a (read-only) accessor to that property.
> and save-excursion to behave like a proper let-binding.
You can always use save-excursion in the other thread, no?
> 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.
That's one way of looking at save-excursion. Another way is to look
at it as a means for a thread to protect its own position of point
from changes by other threads. So from that POV, it's the other
thread which needs to use save-excursion.
> Does that convince you?
Convince me to do what? redesign and reimplement Lisp threads in
Emacs with very different design goals?
- save-excursion and multi-thread?, Qiantan Hong, 2021/09/26
- Re: save-excursion and multi-thread?, Eli Zaretskii, 2021/09/26
- Re: save-excursion and multi-thread?, Qiantan Hong, 2021/09/26
- Re: save-excursion and multi-thread?, Qiantan Hong, 2021/09/26
- Re: save-excursion and multi-thread?, Eli Zaretskii, 2021/09/26
- Re: save-excursion and multi-thread?, Qiantan Hong, 2021/09/26
- Re: save-excursion and multi-thread?,
Eli Zaretskii <=
- Re: save-excursion and multi-thread?, Qiantan Hong, 2021/09/26
- Re: save-excursion and multi-thread?, Qiantan Hong, 2021/09/26
- Re: save-excursion and multi-thread?, Eli Zaretskii, 2021/09/27
- Re: save-excursion and multi-thread?, Richard Stallman, 2021/09/28
- Re: save-excursion and multi-thread?, dick, 2021/09/28
- Re: save-excursion and multi-thread?, Qiantan Hong, 2021/09/28
- Re: save-excursion and multi-thread?, Eli Zaretskii, 2021/09/29
- Re: save-excursion and multi-thread?, Eli Zaretskii, 2021/09/27
- Re: save-excursion and multi-thread?, Qiantan Hong, 2021/09/27
- Re: save-excursion and multi-thread?, Eli Zaretskii, 2021/09/27