[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to disable undo recording within a defun?
From: |
Stefan Monnier |
Subject: |
Re: How to disable undo recording within a defun? |
Date: |
Thu, 16 Sep 2021 19:41:03 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> I'm writting a defun, and would like to disable entirely the recording
>> of undo information while this function is executing. Is this
>> possible? If so, what is the way to do this? Thanks,
> See function buffer-disable-undo and variable buffer-undo-list.
It's very unusual to disable recording undo, and it is usually
problematic because the undo-records before and after the chunk you want
to skip can't be used together unless the chunk you skip ends up doing
"nothing".
So maybe you're looking for `with-silent-modifications` which can be
used when the modifications to the buffer are "negligible" (typically
in the sense that they don't affect what would get saved into the file).
Stefan