From: Gergely Risko Date: Tue, 14 Aug 2012 05:09:35 +0000 (+0800) Subject: Fix for undo recording in decode_coding. X-Git-Tag: emacs-24.2.90~694 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f48b82fd19703c5001c9cceb14b4d8372ce2b083;p=emacs.git Fix for undo recording in decode_coding. * coding.c (decode_coding): Record buffer modification before disabling undo_list. Fixes: debbugs:11773 --- 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); }