diff options
| author | Stefan Monnier | 2008-02-27 04:10:15 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-02-27 04:10:15 +0000 |
| commit | 18a9f8d9bc1a3ce57253ca05a2910b8d693ce08e (patch) | |
| tree | 21bff96d253a11d519b98299bc6b78995ced63c0 /src/fileio.c | |
| parent | d379ff015f617a08bd211d639eb55b21c8ec76c9 (diff) | |
| download | emacs-18a9f8d9bc1a3ce57253ca05a2910b8d693ce08e.tar.gz emacs-18a9f8d9bc1a3ce57253ca05a2910b8d693ce08e.zip | |
(Finsert_file_contents): Don't reset undo_list if no change
is made to the buffer.
Diffstat (limited to 'src/fileio.c')
| -rw-r--r-- | src/fileio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c index e2d399f5a45..4430cf4db57 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3716,6 +3716,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3716 | struct stat st; | 3716 | struct stat st; |
| 3717 | register int fd; | 3717 | register int fd; |
| 3718 | int inserted = 0; | 3718 | int inserted = 0; |
| 3719 | int nochange = 0; | ||
| 3719 | register int how_much; | 3720 | register int how_much; |
| 3720 | register int unprocessed; | 3721 | register int unprocessed; |
| 3721 | int count = SPECPDL_INDEX (); | 3722 | int count = SPECPDL_INDEX (); |
| @@ -4281,7 +4282,10 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4281 | { | 4282 | { |
| 4282 | specpdl_ptr--; | 4283 | specpdl_ptr--; |
| 4283 | /* Truncate the buffer to the size of the file. */ | 4284 | /* Truncate the buffer to the size of the file. */ |
| 4284 | del_range_byte (same_at_start, same_at_end, 0); | 4285 | if (same_at_start == same_at_end) |
| 4286 | nochange = 1; | ||
| 4287 | else | ||
| 4288 | del_range_byte (same_at_start, same_at_end, 0); | ||
| 4285 | inserted = 0; | 4289 | inserted = 0; |
| 4286 | 4290 | ||
| 4287 | unbind_to (this_count, Qnil); | 4291 | unbind_to (this_count, Qnil); |
| @@ -4628,7 +4632,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4628 | 4632 | ||
| 4629 | if (!NILP (visit)) | 4633 | if (!NILP (visit)) |
| 4630 | { | 4634 | { |
| 4631 | if (!EQ (current_buffer->undo_list, Qt)) | 4635 | if (!EQ (current_buffer->undo_list, Qt) && !nochange) |
| 4632 | current_buffer->undo_list = Qnil; | 4636 | current_buffer->undo_list = Qnil; |
| 4633 | 4637 | ||
| 4634 | if (NILP (handler)) | 4638 | if (NILP (handler)) |