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 19:05:36 +0200 Message-ID: <836110blpb.fsf@gnu.org> References: <83r3jpc2of.fsf@gnu.org> <87h9kkbz6k.fsf@russet.org.uk> <87d1v8bsbf.fsf@russet.org.uk> <83bnasbnlq.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1447780000 18680 80.91.229.3 (17 Nov 2015 17:06:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 17:06:40 +0000 (UTC) Cc: emacs-devel@gnu.org, phillip.lord@russet.org.uk To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 17 18:06:25 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 1Zyji1-0005lA-2T for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2015 18:06:21 +0100 Original-Received: from localhost ([::1]:59717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyji0-0005Zh-Kh for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2015 12:06:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyjhQ-0005X3-Hq for emacs-devel@gnu.org; Tue, 17 Nov 2015 12:05:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyjhL-0004EC-NV for emacs-devel@gnu.org; Tue, 17 Nov 2015 12:05:44 -0500 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:59767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyjhL-0004Dt-GD for emacs-devel@gnu.org; Tue, 17 Nov 2015 12:05:39 -0500 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NXY00500XYRKG00@mtaout25.012.net.il> for emacs-devel@gnu.org; Tue, 17 Nov 2015 19:03:05 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NXY00236Y145V30@mtaout25.012.net.il>; Tue, 17 Nov 2015 19:03:05 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.181 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:194656 Archived-At: > From: Stefan Monnier > Cc: phillip.lord@russet.org.uk, emacs-devel@gnu.org > Date: Tue, 17 Nov 2015 11:49:04 -0500 > > >> But of course, in reality it's not the whole record_insert that needs to > >> be moved, only the run_undoable_change within it. > >> So if it's difficult to move record_insert to safe spot, maybe we should > >> take run_undoable_change out of it. > >> E.g. maybe we could call run_undoable_change from > >> prepare_to_modify_buffer instead. > > Beware: prepare_to_modify_buffer is not always called. > > When would it not be called? E.g., in insert_from_gap. Also, in many insdel.c functions when they are called with the PREPARE argument false. > You mean there are cases where we'd add stuff to the undo list but > we don't run before-change-functions? I don't know. I don't think we have such bugs, but thinking is one thing and convincing yourself it's true by looking at the callers is something entirely different...