1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-17 19:30:38 -08:00

Fix for undo recording in decode_coding.

* coding.c (decode_coding): Record buffer modification before
disabling undo_list.

Fixes: debbugs:11773
This commit is contained in:
Gergely Risko 2012-08-14 13:09:35 +08:00 committed by Chong Yidong
parent fd318b5407
commit f48b82fd19
2 changed files with 14 additions and 0 deletions

View file

@ -7102,6 +7102,15 @@ decode_coding (struct coding_system *coding)
set_buffer_internal (XBUFFER (coding->dst_object));
if (GPT != PT)
move_gap_both (PT, PT_BYTE);
/* We must disable undo_list in order to record the whole insert
transaction via record_insert at the end. But doing so also
disables the recording of the first change to the undo_list.
Therefore we check for first change here and record it via
record_first_change if needed. */
if (MODIFF <= SAVE_MODIFF)
record_first_change ();
undo_list = BVAR (current_buffer, undo_list);
BSET (current_buffer, undo_list, Qt);
}