[Top][All Lists]

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

Re: Unbalanced change hooks (part 2)

From: Alan Mackenzie
Subject: Re: Unbalanced change hooks (part 2)
Date: Sun, 31 Jul 2016 15:21:58 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Noam.

On Sun, Jul 31, 2016 at 09:58:50AM -0400, Noam Postavsky wrote:
> On Sun, Jul 31, 2016 at 8:16 AM, Alan Mackenzie <address@hidden> wrote:

> > The pertinent functions are insert_1_both, replace_range, del_range_1,
> > del_range_byte, and del_range_both.  These functions fall into two
> > groups, the first two in group 1 and the rest in group 2.  Those in group
> > 2 always call signal_after_change, those in group 1 never do.

> replace_range should be in group 2 as well, no?

Er, yes, it should.  ;-)  So we have a group of 4 and a single function.
Thanks for spotting that.

> > There are invocations of group 2 functions with `prepare' false.  This
> > wrongly invokes after-change-functions without having invoked
> > before-change-functions.

> replace_range has one call with prepare = false, it's in
> Fsubst_char_in_region. I think the idea is that the caller takes care
> of calling both before (by calling modify_text) and after (by explicit
> call and/or(??) by replace_range) change functions, though the code is
> sufficiently convoluted that I can't really say whether it works
> correctly or not.

By taking signal_after_change out of prepare_to_modify_buffer, I'm
rather hoping to reduce the convolution.

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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