From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Calling Lisp from undo.c's record_* functions Date: Tue, 17 Nov 2015 14:09:36 -0500 Message-ID: References: <83r3jpc2of.fsf@gnu.org> <87h9kkbz6k.fsf@russet.org.uk> <87d1v8bsbf.fsf@russet.org.uk> <83bnasbnlq.fsf@gnu.org> <836110blpb.fsf@gnu.org> <8337w4bj53.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447787409 14553 80.91.229.3 (17 Nov 2015 19:10:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 19:10:09 +0000 (UTC) Cc: emacs-devel@gnu.org, phillip.lord@russet.org.uk To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 17 20:10:01 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 1Zyldg-0002fz-Tu for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2015 20:10:01 +0100 Original-Received: from localhost ([::1]:60301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyldf-0004Je-Sv for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2015 14:09:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyldP-0004JM-Oj for emacs-devel@gnu.org; Tue, 17 Nov 2015 14:09:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyldK-0004KR-NX for emacs-devel@gnu.org; Tue, 17 Nov 2015 14:09:43 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:53173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyldK-0004K6-Hr; Tue, 17 Nov 2015 14:09:38 -0500 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id tAHJ9bH1023268; Tue, 17 Nov 2015 14:09:37 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id E046D66157; Tue, 17 Nov 2015 14:09:36 -0500 (EST) In-Reply-To: <8337w4bj53.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 17 Nov 2015 20:00:56 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5493=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5493> : inlines <4006> : streams <1539712> : uri <2084681> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:194664 Archived-At: > Did you take a look at subst-char-in-region? It calls > prepare_to_modify_buffer from within a loop which seems to assume that > (a) gap position doesn't move, and (b) that pointer into buffer text > is valid across the call to prepare_to_modify_buffer. GC could > invalidate both assumptions, no? [...] > Bottom line: I think all the functions that manipulate the gap should > be carefully audited to identify any potential problem with this > approach. prepare_to_modify_buffer runs before-change-functions, so it's been running Elisp code for many years. Maybe there are still problems lurking, but I'm not too worried and they'd have to be fixed regardless of what we do with run_undoable_change. Stefan