summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2002-03-05 00:09:15 +0000
committerKenichi Handa <handa@m17n.org>2002-03-05 00:09:15 +0000
commit1c157f8ddc376ed384e7c990c80de72dea23bd3e (patch)
treebdc34f1da7754021c205c48cb945a132863d8fed /src
parent0be8721c15d288d1977291469fa3f12cdd527cc0 (diff)
downloademacs-1c157f8ddc376ed384e7c990c80de72dea23bd3e.tar.gz
(Finsert_file_contents): Set coding_system to Qnil
earlier. If inserted is zero and the coding system doesn't require flushing, don't call decode_coding_gap.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 529722ded82..eb12810eeaa 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3594,6 +3594,10 @@ actually used. */)
CHECK_STRING (filename);
filename = Fexpand_file_name (filename, Qnil);
+ /* The value Qnil means that the coding system is not yet
+ decided. */
+ coding_system = Qnil;
+
/* If the file name has special constructs in it,
call the corresponding file handler. */
handler = Ffind_file_name_handler (filename, Qinsert_file_contents);
@@ -3713,9 +3717,6 @@ actually used. */)
}
}
- /* The value Qnil means that the coding system is not yet
- decided. */
- coding_system = Qnil;
if (BEG < Z)
{
/* Decide the coding system to use for reading the file now
@@ -4405,8 +4406,9 @@ actually used. */)
current_buffer->enable_multibyte_characters = Qnil;
}
- if (CODING_REQUIRE_DETECTION (&coding)
- || CODING_REQUIRE_DECODING (&coding))
+ if ((CODING_REQUIRE_DETECTION (&coding)
+ || CODING_REQUIRE_DECODING (&coding))
+ && (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding)))
{
move_gap_both (PT, PT_BYTE);
GAP_SIZE += inserted;