[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a way to know if this-command altered the buffer?
From: |
Marcin Borkowski |
Subject: |
Re: Is there a way to know if this-command altered the buffer? |
Date: |
Wed, 12 May 2021 07:39:39 +0200 |
User-agent: |
mu4e 1.1.0; emacs 28.0.50 |
On 2021-05-12, at 06:27, Emanuel Berg via Users list for the GNU Emacs text
editor <help-gnu-emacs@gnu.org> wrote:
> Marcin Borkowski wrote:
>
>> I want to run some function in a certain hook. This function
>> will update some info displayed using an overlay. The info
>> depends on the buffer contents and is pretty expensive to
>> compute, so I'd like to only display it if the buffer
>> really changed.
>>
>> Is there a way to know if `this-command' actually changed
>> the buffer (as opposed to e.g. point motion)?
>
> Maybe these
>
> buffer-chars-modified-tick
> buffer-modified-tick
Wow, I never heard about those! Interesting! Though I think I found
the best answer (after-change-functions), this is also very interesting
and possibly useful (though in other circumstances, I think).
Thanks!
--
Marcin Borkowski
http://mbork.pl