diff options
| author | Kenichi Handa | 2004-01-29 01:27:12 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-01-29 01:27:12 +0000 |
| commit | 9a7f80aa9096bc32d0e564ea54ccd5b0efc88e2f (patch) | |
| tree | cd30bd857fd60570da94a942ff64a0e63a65427a /src | |
| parent | 75e2a253147e8843a5ff6aff6a6159f5e10c133c (diff) | |
| download | emacs-9a7f80aa9096bc32d0e564ea54ccd5b0efc88e2f.tar.gz emacs-9a7f80aa9096bc32d0e564ea54ccd5b0efc88e2f.zip | |
(Finsert_file_contents): Avoid detecting a code twice.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/fileio.c b/src/fileio.c index cb983cc78d4..c5089cbe78d 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -4415,11 +4415,10 @@ actually used. */) | |||
| 4415 | /* Since we are sure that the current buffer was empty | 4415 | /* Since we are sure that the current buffer was empty |
| 4416 | before the insertion, we can toggle | 4416 | before the insertion, we can toggle |
| 4417 | enable-multibyte-characters directly here without taking | 4417 | enable-multibyte-characters directly here without taking |
| 4418 | care of marker adjustment and byte combining problem. By | 4418 | care of marker adjustment. By this way, we can run Lisp |
| 4419 | this way, we can run Lisp program safely before decoding | 4419 | program safely before decoding the inserted text. */ |
| 4420 | the inserted text. */ | ||
| 4421 | Lisp_Object unwind_data; | 4420 | Lisp_Object unwind_data; |
| 4422 | int count = SPECPDL_INDEX (); | 4421 | int count = SPECPDL_INDEX (); |
| 4423 | 4422 | ||
| 4424 | unwind_data = Fcons (current_buffer->enable_multibyte_characters, | 4423 | unwind_data = Fcons (current_buffer->enable_multibyte_characters, |
| 4425 | Fcons (current_buffer->undo_list, | 4424 | Fcons (current_buffer->undo_list, |
| @@ -4468,15 +4467,7 @@ actually used. */) | |||
| 4468 | if (!NILP (visit)) | 4467 | if (!NILP (visit)) |
| 4469 | { | 4468 | { |
| 4470 | /* When we visit a file by raw-text, we change the buffer to | 4469 | /* When we visit a file by raw-text, we change the buffer to |
| 4471 | unibyte. If we have not yet decided how to decode a text, | 4470 | unibyte. */ |
| 4472 | decide it at first by detecting the file's encoding. */ | ||
| 4473 | if (CODING_REQUIRE_DETECTION (&coding)) | ||
| 4474 | { | ||
| 4475 | coding_system = detect_coding_system (PT_ADDR, inserted, inserted, | ||
| 4476 | 1, 0, coding_system); | ||
| 4477 | setup_coding_system (coding_system, &coding); | ||
| 4478 | } | ||
| 4479 | |||
| 4480 | if (CODING_FOR_UNIBYTE (&coding) | 4471 | if (CODING_FOR_UNIBYTE (&coding) |
| 4481 | /* Can't do this if part of the buffer might be preserved. */ | 4472 | /* Can't do this if part of the buffer might be preserved. */ |
| 4482 | && NILP (replace)) | 4473 | && NILP (replace)) |