+2008-02-27 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (Finsert_file_contents): Don't reset undo_list if no change
+ is made to the buffer.
+
2008-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
* dispextern.h (face_at_buffer_position, face_for_overlay_string)
struct stat st;
register int fd;
int inserted = 0;
+ int nochange = 0;
register int how_much;
register int unprocessed;
int count = SPECPDL_INDEX ();
{
specpdl_ptr--;
/* Truncate the buffer to the size of the file. */
- del_range_byte (same_at_start, same_at_end, 0);
+ if (same_at_start == same_at_end)
+ nochange = 1;
+ else
+ del_range_byte (same_at_start, same_at_end, 0);
inserted = 0;
unbind_to (this_count, Qnil);
if (!NILP (visit))
{
- if (!EQ (current_buffer->undo_list, Qt))
+ if (!EQ (current_buffer->undo_list, Qt) && !nochange)
current_buffer->undo_list = Qnil;
if (NILP (handler))