From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: save-excursion and multi-thread? Date: Tue, 28 Sep 2021 19:33:37 -0400 Message-ID: References: <5713E898-28B8-456C-992C-F0332FACA9FF@mit.edu> <8335prnqtq.fsf@gnu.org> <57C38454-3A17-47CC-A820-C7E63D8C2BBB@mit.edu> <83y27jmam8.fsf@gnu.org> <8DD13632-54F3-4FC4-8789-C2275820FA94@mit.edu> <83r1dbm9kc.fsf@gnu.org> <6FB8B808-3423-48A1-8B0F-8E106DEB9C56@mit.edu> <83o88fm8zb.fsf@gnu.org> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20710"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, emacs-devel@gnu.org To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 29 01:34:28 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVMcG-0005Br-QU for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Sep 2021 01:34:28 +0200 Original-Received: from localhost ([::1]:47854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVMcF-0008TC-Hy for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Sep 2021 19:34:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVMbT-0007mz-9I for emacs-devel@gnu.org; Tue, 28 Sep 2021 19:33:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34030) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVMbS-0000OT-L9; Tue, 28 Sep 2021 19:33:38 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mVMbR-00073l-RN; Tue, 28 Sep 2021 19:33:38 -0400 In-Reply-To: (message from Qiantan Hong on Sun, 26 Sep 2021 19:45:24 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275745 Archived-At: [[[ 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)