From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: Calling Lisp from undo.c's record_* functions Date: Tue, 17 Nov 2015 21:05:43 +0000 Message-ID: <87bnasmj4o.fsf@russet.org.uk> 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 1447796281 28047 80.91.229.3 (17 Nov 2015 21:38:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 21:38:01 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 17 22:37:57 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 1Zynwg-00057g-Uu for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2015 22:37:47 +0100 Original-Received: from localhost ([::1]:60748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zynwg-0006Hg-Cl for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2015 16:37:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZynwL-0006Gc-Kz for emacs-devel@gnu.org; Tue, 17 Nov 2015 16:37:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZynwK-0004Tq-Oj for emacs-devel@gnu.org; Tue, 17 Nov 2015 16:37:25 -0500 Original-Received: from cheviot12.ncl.ac.uk ([128.240.234.12]:60986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZynwG-0004T1-0s; Tue, 17 Nov 2015 16:37:20 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot12.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1ZynwE-00082v-Bq; Tue, 17 Nov 2015 21:37:18 +0000 Original-Received: from cpc6-benw10-2-0-cust45.gate.cable.virginm.net ([92.238.179.46] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1ZynwD-000582-Jv; Tue, 17 Nov 2015 21:37:17 +0000 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/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.12 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:194672 Archived-At: Eli Zaretskii writes: >> So I think moving the call to run_undoable_change into >> prepare_to_modify_buffer is n attractive solution to this problem, since >> it preserves the use of Elisp, and it probably also simplifies the code >> (since we can remove most/all other calls to run_undoable_change). > > 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? This function also signals before-change and after-change values which don't match, so feel free to rewrite it! It's on my list of things to do, but it will take me a while. Phil