emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it safe to use the combine-after-change-calls like this?


From: Alan Mackenzie
Subject: Re: Is it safe to use the combine-after-change-calls like this?
Date: Fri, 26 Apr 2019 10:31:39 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]