aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2008-02-27 04:10:15 +0000
committerStefan Monnier <[email protected]>2008-02-27 04:10:15 +0000
commit18a9f8d9bc1a3ce57253ca05a2910b8d693ce08e (patch)
tree21bff96d253a11d519b98299bc6b78995ced63c0 /src
parentd379ff015f617a08bd211d639eb55b21c8ec76c9 (diff)
(Finsert_file_contents): Don't reset undo_list if no change
is made to the buffer.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fileio.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2e81f6dcfb..edb6201161 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-27 Stefan Monnier <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Don't reset undo_list if no change
+ is made to the buffer.
+
2008-02-26 Stefan Monnier <[email protected]>
* dispextern.h (face_at_buffer_position, face_for_overlay_string)
diff --git a/src/fileio.c b/src/fileio.c
index e2d399f5a4..4430cf4db5 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3716,6 +3716,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
struct stat st;
register int fd;
int inserted = 0;
+ int nochange = 0;
register int how_much;
register int unprocessed;
int count = SPECPDL_INDEX ();
@@ -4281,7 +4282,10 @@ variable `last-coding-system-used' to the coding system actually used. */)
{
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);
@@ -4628,7 +4632,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
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))