[Top][All Lists]

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

Re: jit lock sit-for provokes redisplay provokes imenu

From: Richard Stallman
Subject: Re: jit lock sit-for provokes redisplay provokes imenu
Date: Mon, 24 Jul 2006 10:42:38 -0400

     > Rather than increment CHARS_MODIFF separately,
     > it should copy the value from MODIFF.
     > That way, values of CHARS_MODIFF will be comparable with values
     > that were copied from MODIFF.

    Yes, but it will deprive you of eventually introducing a variable
    SAVE_CHARS_MODIFF and tell whether an insertion/deletion occurred
    since the last save because CHARS_MODIFF > SAVE_CHARS_MODIFF.

I do not see how you reach that conclusion.  As far as I can see, if
we want to someday have SAVE_CHARS_MODIFF, my way of handling
CHARS_MODIFF will not be any obstacle to doing so.

However, with my way of handling CHARS_MODIFF, there is no need
for a separate SAVE_CHARS_MODIFF.  SAVE_MODIFF can be used.
If CHARS_MODIFF > SAVE_MODIFF, then the text in the buffer
has been altered.  If SAVE_MODIFF >= CHARS_MODIFF, then the
text has not been altered since the last save.

This is assuming that saving copies MODIFF to SAVE_MODIFF,
and that we copy MODIFF to CHARS_MODIFF whenever we change
the characters in the buffer.

    +     int chars_modiff;             /* This counts insert/delete events
    +                              for this buffer.  It is incremented for
    +                              each such event, and never otherwise
    +                              changed.  */

That comment is not true for the current code.

Aside from that, your latest patch is clean enough.

    Perhaps the cleanest solution would be to equip modify_region with an
    additional parameter, say preserve_chars_modiff, and do everything in

It might be better.  Please give it a try and see.

reply via email to

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