From f48b82fd19703c5001c9cceb14b4d8372ce2b083 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Tue, 14 Aug 2012 13:09:35 +0800 Subject: [PATCH] Fix for undo recording in decode_coding. * coding.c (decode_coding): Record buffer modification before disabling undo_list. Fixes: debbugs:11773 --- src/ChangeLog | 5 +++++ src/coding.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 9cd76d2fc5f..e622d95bff8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-14 Gergely Risko + + * coding.c (decode_coding): Record buffer modification before + disabling undo_list (Bug#11773). + 2012-08-14 Dmitry Antipov Revert and cleanup some recent overlay changes. diff --git a/src/coding.c b/src/coding.c index 08633d8bcff..c601a18b26e 100644 --- a/src/coding.c +++ b/src/coding.c @@ -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); } -- 2.39.2