emacs-devel
[Top][All Lists]
Advanced

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

Re: buffer-modified-tick and text properties


From: Eli Zaretskii
Subject: Re: buffer-modified-tick and text properties
Date: Sat, 20 Apr 2024 17:09:10 +0300

> From: JD Smith <jdtsmith@gmail.com>
> Date: Sat, 20 Apr 2024 08:47:42 -0400
> 
> I had hoped to compare a saved and current buffer-modified-tick in a 
> post-command-hook, to tell me whether
> the command that lead to it had modified the buffer text, but this is not a 
> reliable way to do so when text
> properties are being changed as a result of non-edit commands (like motion).

If you want to know only about changes to characters, perhaps
buffer-chars-modified-tick is a better function to use?

Or how about if you explain why the fact that buffer-modified-tick
changes even under with-silent-modifications gets in your way, and
what would you like to do that need that tick to be sensitive to what
with-silent-modifications does?

> Plenty of modes compare the buffer tick against a saved value to infer 
> whether the buffer text has been
> modified since the last update.  That logic will be defeated if other modes 
> make text property changes.  Is
> there a way to inhibit changes in the buffer-tick when you are just changing 
> simple text properties?

You cannot do that without breaking redisplay, because the display
engine uses the tick value to know when it might need to redisplay
portions of a window.  But I'm still uncertain why this presents a
problem, given that we have buffer-chars-modified-tick.  What am I
missing?



reply via email to

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