diff options
| author | Gerd Moellmann | 2000-12-04 13:30:09 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-12-04 13:30:09 +0000 |
| commit | ed8e506f242f571faea4ad7767321aac6b2fb8de (patch) | |
| tree | c290e07288429828d59014ef9da6f4d8195af271 | |
| parent | 6c083b4cec6d39893a0fa3c2c994e6c05bf0a07b (diff) | |
| download | emacs-ed8e506f242f571faea4ad7767321aac6b2fb8de.tar.gz emacs-ed8e506f242f571faea4ad7767321aac6b2fb8de.zip | |
(Finsert_file_contents): When VISIT is t, don't
record undo information for format-decode.
| -rw-r--r-- | src/fileio.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c index 3385da52da0..0eb07ce3bc1 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3418,7 +3418,7 @@ actually used.") | |||
| 3418 | int inserted = 0; | 3418 | int inserted = 0; |
| 3419 | register int how_much; | 3419 | register int how_much; |
| 3420 | register int unprocessed; | 3420 | register int unprocessed; |
| 3421 | int count = specpdl_ptr - specpdl; | 3421 | int count = BINDING_STACK_SIZE (); |
| 3422 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 3422 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 3423 | Lisp_Object handler, val, insval, orig_filename; | 3423 | Lisp_Object handler, val, insval, orig_filename; |
| 3424 | Lisp_Object p; | 3424 | Lisp_Object p; |
| @@ -4289,10 +4289,24 @@ actually used.") | |||
| 4289 | /* Decode file format */ | 4289 | /* Decode file format */ |
| 4290 | if (inserted > 0) | 4290 | if (inserted > 0) |
| 4291 | { | 4291 | { |
| 4292 | int empty_undo_list_p = 0; | ||
| 4293 | |||
| 4294 | /* If we're anyway going to discard undo information, don't | ||
| 4295 | record it in the first place. The buffer's undo list at this | ||
| 4296 | point is either nil or t when visiting a file. */ | ||
| 4297 | if (!NILP (visit)) | ||
| 4298 | { | ||
| 4299 | empty_undo_list_p = NILP (current_buffer->undo_list); | ||
| 4300 | current_buffer->undo_list = Qt; | ||
| 4301 | } | ||
| 4302 | |||
| 4292 | insval = call3 (Qformat_decode, | 4303 | insval = call3 (Qformat_decode, |
| 4293 | Qnil, make_number (inserted), visit); | 4304 | Qnil, make_number (inserted), visit); |
| 4294 | CHECK_NUMBER (insval, 0); | 4305 | CHECK_NUMBER (insval, 0); |
| 4295 | inserted = XFASTINT (insval); | 4306 | inserted = XFASTINT (insval); |
| 4307 | |||
| 4308 | if (!NILP (visit)) | ||
| 4309 | current_buffer->undo_list = empty_undo_list_p ? Qnil : Qt; | ||
| 4296 | } | 4310 | } |
| 4297 | 4311 | ||
| 4298 | if (set_coding_system) | 4312 | if (set_coding_system) |