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: Thu, 19 Nov 2015 13:17:54 -0500 Message-ID: References: <83r3jpc2of.fsf@gnu.org> <87h9kkbz6k.fsf@russet.org.uk> <838u5wbmvu.fsf@gnu.org> <83ziyc9zs0.fsf@gnu.org> <83wptg9dcd.fsf@gnu.org> <87610zsd3u.fsf@russet.org.uk> <83io4z9ozx.fsf@gnu.org> <87wpte8fas.fsf@russet.org.uk> <83poz67zpd.fsf@gnu.org> <838u5t98hp.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447957116 16570 80.91.229.3 (19 Nov 2015 18:18:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2015 18:18:36 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, phillip.lord@russet.org.uk To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 19 19:18:27 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 1ZzTmi-0001hn-PZ for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2015 19:18:16 +0100 Original-Received: from localhost ([::1]:43345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzTmi-0001EM-8t for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2015 13:18:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzTmU-0001E2-Fs for emacs-devel@gnu.org; Thu, 19 Nov 2015 13:18:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzTmT-0002bb-QB for emacs-devel@gnu.org; Thu, 19 Nov 2015 13:18:02 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:38976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzTmP-0002b6-24; Thu, 19 Nov 2015 13:17:57 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id tAJIHsHH007315; Thu, 19 Nov 2015 13:17:55 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id E5516602AE; Thu, 19 Nov 2015 13:17:54 -0500 (EST) In-Reply-To: <838u5t98hp.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 19 Nov 2015 19:58:26 +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 RV5495=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5495> : inlines <4014> : streams <1540764> : uri <2085918> 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:194812 Archived-At: >> > prepare_to_modify_buffer. This seems to avoid calling Lisp while the >> > gap is being manipulated, but my question is: are there any pitfalls >> > to calling Lisp code on the level of insdel.c functions? I'd like to >> > hear your opinion before we decide whether to install the proposed >> > solution, or look for a safer one. >> As mentioned earlier, this function has been running Elisp code forever >> already via the before-change-functions hook. > That is true, but unlike before-change-functions, which is not always > non-nil, the undo-related call will always be run. So if calling Lisp > there could cause some problems, those problems will become much more > frequent now. That's true. So we may uncover bugs. Since those bugs would presumably also exist when before-change-functions is non-nil, we'd have to find a solution for before-change-functions and that solution would probably also be applicable to run_undoable_changes. Stefan