From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Calling Lisp from undo.c's record_* functions Date: Tue, 17 Nov 2015 18:35:56 +0200 Message-ID: <83a8qcbn2r.fsf@gnu.org> References: <83r3jpc2of.fsf@gnu.org> <87h9kkbz6k.fsf@russet.org.uk> <87d1v8bsbf.fsf@russet.org.uk> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1447778188 19786 80.91.229.3 (17 Nov 2015 16:36:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 16:36:28 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: phillip.lord@russet.org.uk (Phillip Lord) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 17 17:36:20 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZyjEu-00027V-4o for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2015 17:36:16 +0100 Original-Received: from localhost ([::1]:59381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyjEt-0002rv-KZ for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2015 11:36:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyjEp-0002rq-8O for emacs-devel@gnu.org; Tue, 17 Nov 2015 11:36:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyjEm-00048m-2F for emacs-devel@gnu.org; Tue, 17 Nov 2015 11:36:11 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:47665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyjEl-00048W-Qd for emacs-devel@gnu.org; Tue, 17 Nov 2015 11:36:07 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NXY00300WI2KU00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Tue, 17 Nov 2015 18:35:57 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NXY0037TWRXLB00@a-mtaout21.012.net.il>; Tue, 17 Nov 2015 18:35:57 +0200 (IST) In-reply-to: <87d1v8bsbf.fsf@russet.org.uk> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:194651 Archived-At: > From: phillip.lord@russet.org.uk (Phillip Lord) > Cc: Eli Zaretskii , > Date: Tue, 17 Nov 2015 14:42:44 +0000 > > > The "critical section" is the span of code during which the buffer is > > "being worked on" by the insertion function, so during this time, the > > buffer shouldn't be modified by anyone else in any way: no Elisp code > > should be run, no GC should take place. > > Assuming the documentation of undo.c is rigourously followed, then this > should only be a problem for insert. All the others say "at the > beginning of the command" or "about to happen". Only insertion says > "before or after". Although, record_insert calls record_point which > rather confuses me -- surely in record_insert can be after, so can > record_point. I don't recommend relying on such promises too much. You can never know if someone, some day violates it, whether consciously or inadvertently. In fact, it looks like replace_range already does just that. > There are only 7 calls to record_insert so changing the so record_insert > is *always* before would be possible. Did you look at insert_from_gap? AFAIU, it assumes that the gap position stays put during the call to record_insert. If that can call Lisp or GC, that assumption is false. > Big change to make at this point in the release cycle. No, I don't think so. We still have several months to go. Btw, could you perhaps write a short description of this change and its effects in the Lisp level for etc/NEWS? I see there's not a word about this there. Bonus points if you also update the ELisp manual. Thanks.