From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Is it safe to use the combine-after-change-calls like this? Date: Fri, 26 Apr 2019 10:31:39 +0000 Message-ID: <20190426103139.GA4720@ACM> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="225947"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: "emacs-devel@gnu.org" To: Zhang Haijun Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 26 12:32:40 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJy9n-000wes-5H for ged-emacs-devel@m.gmane.org; Fri, 26 Apr 2019 12:32:39 +0200 Original-Received: from localhost ([127.0.0.1]:44513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJy9m-0004ZX-47 for ged-emacs-devel@m.gmane.org; Fri, 26 Apr 2019 06:32:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJy8w-0004YO-OY for emacs-devel@gnu.org; Fri, 26 Apr 2019 06:31:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJy8v-0000jf-N7 for emacs-devel@gnu.org; Fri, 26 Apr 2019 06:31:46 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:18727 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hJy8v-0000iu-Ci for emacs-devel@gnu.org; Fri, 26 Apr 2019 06:31:45 -0400 Original-Received: (qmail 96013 invoked by uid 3782); 26 Apr 2019 10:31:40 -0000 Original-Received: from acm.muc.de (p4FE15E52.dip0.t-ipconnect.de [79.225.94.82]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 26 Apr 2019 12:31:39 +0200 Original-Received: (qmail 5455 invoked by uid 1000); 26 Apr 2019 10:31:39 -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:235954 Archived-At: Hello, Zhang. On Thu, Apr 18, 2019 at 05:34:56 +0000, Zhang Haijun wrote: > > combine-after-change-calls is ignored when before-change-functions is non-nil. > I just recognize this. It is not nil in c++-mode buffers. CC Mode maintains several caches of state information, which are updated in the before-change-functions and after-change-functions hooks. This is on the assumption that successive buffer changes are usually close to eachother. Obviously, this is less true in iedit-mode, and it is likely that these caches hinder rather than help in this case. > > Also, regarding interaction with non-CC-mode buffers: you might be able > > to improve the efficiency of the code by executing the command of the > > various cursors starting with the one closest to point-max and finishing > > with the one closest to point-min. > I don’t understand this well. I see that when iedit-mode is on, it > calls after-change-functions on change around every active cursors for > every char inputing. One thing which might help in the future is the macro combine-change-calls, which is a bit like combine-after-change-calls, but also works when before-change-functions isn't nil. combine-change-calls is in the Emacs repository master, and should be getting released with Emacs 27.1 in the medium future (maybe about a year from now). -- Alan Mackenzie (Nuremberg, Germany).