]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure undo-boundary after insert-file-contents.
authorPhillip Lord <phillip.lord@russet.org.uk>
Mon, 20 Jun 2016 13:26:02 +0000 (14:26 +0100)
committerPhillip Lord <phillip.lord@russet.org.uk>
Tue, 21 Jun 2016 20:34:08 +0000 (21:34 +0100)
* src/fileio.c: Record undoable change during insert-file-contents.

Addresses Bug #23785.

src/fileio.c

index b11f9233ab4891232a4f785c41f0fc9d531c4814..746aac42a9c924366960c0b32e859e88227baa25 100644 (file)
@@ -4047,8 +4047,14 @@ by calling `format-decode', which see.  */)
         being called in insert_from_buffer (via in
         prepare_to_modify_buffer).  */
       specbind (intern ("buffer-file-name"), Qnil);
+
+      /* Temporarily enable the undo-buffer to ensure that the change
+         is marked as an undoable one. Bug #23785. */
+      bset_undo_list(current_buffer,Qnil);
       insert_from_buffer (XBUFFER (conversion_buffer),
                          same_at_start_charpos, inserted_chars, 0);
+      bset_undo_list(current_buffer,Qt);
+
       /* Set `inserted' to the number of inserted characters.  */
       inserted = PT - temp;
       /* Set point before the inserted characters.  */