From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Lisp primitives and their calling of the change hooks Date: Wed, 10 Jan 2018 18:45:22 +0000 Message-ID: <20180110184521.GB6175@ACM> References: <83bmi58sao.fsf@gnu.org> <20180107194845.GE22254@ACM> <838td98mqe.fsf@gnu.org> <20180107211055.GF22254@ACM> <837est81bl.fsf@gnu.org> <20180108192415.GA5531@ACM> <83h8rw6oio.fsf@gnu.org> <20180109195357.GA3869@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1515610191 11973 195.159.176.226 (10 Jan 2018 18:49:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 Jan 2018 18:49:51 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 10 19:49:47 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZLRN-0001xb-Fz for ged-emacs-devel@m.gmane.org; Wed, 10 Jan 2018 19:49:33 +0100 Original-Received: from localhost ([::1]:60143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZLTN-0004mJ-5t for ged-emacs-devel@m.gmane.org; Wed, 10 Jan 2018 13:51:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZLSN-0004ks-44 for emacs-devel@gnu.org; Wed, 10 Jan 2018 13:50:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZLSJ-0002Tl-5E for emacs-devel@gnu.org; Wed, 10 Jan 2018 13:50:34 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:63713 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1eZLSI-0002SX-AK for emacs-devel@gnu.org; Wed, 10 Jan 2018 13:50:30 -0500 Original-Received: (qmail 43309 invoked by uid 3782); 10 Jan 2018 18:50:28 -0000 Original-Received: from acm.muc.de (p548C7214.dip0.t-ipconnect.de [84.140.114.20]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 10 Jan 2018 19:50:27 +0100 Original-Received: (qmail 6294 invoked by uid 1000); 10 Jan 2018 18:45:22 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:221803 Archived-At: Hello, Stefan. On Tue, Jan 09, 2018 at 15:07:58 -0500, Stefan Monnier wrote: > > The way I see it, to announce in advance that the original region will be > > deleted (by calling b-c-f for it) is suboptimal. > But not incorrect. > > If the decompression fails, we need to balance that b-c-f with > > a "fake" a-c-f call. > No, we don't. It's still within the rules to announce an upcoming > change with b-c-f and then not to carry through (i.e. not make any > changes and not call a-c-f). It's debatable whether it's within the rules or not. The rules, which we so carefully crafted a few days ago, say, in part; "The arguments to `before-change-functions' will enclose a region in which the individual changes are made, ...". There will never be any changes made in the quasi-deleted region, so to leave it without a balanceing a-c-f call could be construed as against the rules. I'm not saying it's a sensible debate to have, though. More to the point is that the b-c-f call may have made changes to the buffer which need to be undone. (Somebody, sometime, is going to try calling this primitive in a C++ Mode buffer just to see what happens. What they should see is no buffer change, particularly not in the text properties.) Although, with unbalanced b/a-c-f being permitted anyway, for a mode whose b-c-f does make buffer changes, there'll have to be, say, an entry in post-command-hook anyway, to catch these unbalanced calls. > Stefan -- Alan Mackenzie (Nuremberg, Germany).