aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/fileio.c40
2 files changed, 27 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 16737c6f38f..2a50cd86799 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12000-05-24 Kenichi HANDA <handa@etl.go.jp>
2
3 * fileio.c (Finsert_file_contents): Even if a file is not found,
4 execute codes for setting up coding system. Call
5 after-insert-file-functions unconditionally.
6
12000-05-24 Gerd Moellmann <gerd@gnu.org> 72000-05-24 Gerd Moellmann <gerd@gnu.org>
2 8
3 * callproc.c, emacs.c, sysdep.c (setpgrp): Don't define if USG and 9 * callproc.c, emacs.c, sysdep.c (setpgrp): Don't define if USG and
diff --git a/src/fileio.c b/src/fileio.c
index 19d80a9d2f0..47bc651a021 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3643,6 +3643,8 @@ actually used.")
3643 } 3643 }
3644 3644
3645 setup_coding_system (Fcheck_coding_system (val), &coding); 3645 setup_coding_system (Fcheck_coding_system (val), &coding);
3646 /* Ensure we set Vlast_coding_system_used. */
3647 set_coding_system = 1;
3646 3648
3647 if (NILP (current_buffer->enable_multibyte_characters) 3649 if (NILP (current_buffer->enable_multibyte_characters)
3648 && ! NILP (val)) 3650 && ! NILP (val))
@@ -3656,9 +3658,6 @@ actually used.")
3656 coding_system_decided = 1; 3658 coding_system_decided = 1;
3657 } 3659 }
3658 3660
3659 /* Ensure we always set Vlast_coding_system_used. */
3660 set_coding_system = 1;
3661
3662 /* If requested, replace the accessible part of the buffer 3661 /* If requested, replace the accessible part of the buffer
3663 with the file contents. Avoid replacing text at the 3662 with the file contents. Avoid replacing text at the
3664 beginning or end of the buffer that matches the file contents; 3663 beginning or end of the buffer that matches the file contents;
@@ -4133,6 +4132,8 @@ actually used.")
4133 error ("IO error reading %s: %s", 4132 error ("IO error reading %s: %s",
4134 XSTRING (orig_filename)->data, emacs_strerror (errno)); 4133 XSTRING (orig_filename)->data, emacs_strerror (errno));
4135 4134
4135 notfound:
4136
4136 if (! coding_system_decided) 4137 if (! coding_system_decided)
4137 { 4138 {
4138 /* The coding system is not yet decided. Decide it by an 4139 /* The coding system is not yet decided. Decide it by an
@@ -4195,6 +4196,8 @@ actually used.")
4195 setup_coding_system (val, &temp_coding); 4196 setup_coding_system (val, &temp_coding);
4196 bcopy (&temp_coding, &coding, sizeof coding); 4197 bcopy (&temp_coding, &coding, sizeof coding);
4197 } 4198 }
4199 /* Ensure we set Vlast_coding_system_used. */
4200 set_coding_system = 1;
4198 4201
4199 if (NILP (current_buffer->enable_multibyte_characters) 4202 if (NILP (current_buffer->enable_multibyte_characters)
4200 && ! NILP (val)) 4203 && ! NILP (val))
@@ -4238,7 +4241,6 @@ actually used.")
4238 current_buffer->buffer_file_type = Qnil; 4241 current_buffer->buffer_file_type = Qnil;
4239#endif 4242#endif
4240 4243
4241 notfound:
4242 handled: 4244 handled:
4243 4245
4244 if (!NILP (visit)) 4246 if (!NILP (visit))
@@ -4270,10 +4272,6 @@ actually used.")
4270 Fsignal (Qfile_error, 4272 Fsignal (Qfile_error,
4271 Fcons (build_string ("not a regular file"), 4273 Fcons (build_string ("not a regular file"),
4272 Fcons (orig_filename, Qnil))); 4274 Fcons (orig_filename, Qnil)));
4273
4274 /* If visiting nonexistent file, return nil. */
4275 if (current_buffer->modtime == -1)
4276 report_file_error ("Opening input file", Fcons (orig_filename, Qnil));
4277 } 4275 }
4278 4276
4279 /* Decode file format */ 4277 /* Decode file format */
@@ -4298,20 +4296,24 @@ actually used.")
4298 update_compositions (PT, PT, CHECK_BORDER); 4296 update_compositions (PT, PT, CHECK_BORDER);
4299 } 4297 }
4300 4298
4301 if (inserted > 0) 4299 p = Vafter_insert_file_functions;
4300 while (!NILP (p))
4302 { 4301 {
4303 p = Vafter_insert_file_functions; 4302 insval = call1 (Fcar (p), make_number (inserted));
4304 while (!NILP (p)) 4303 if (!NILP (insval))
4305 { 4304 {
4306 insval = call1 (Fcar (p), make_number (inserted)); 4305 CHECK_NUMBER (insval, 0);
4307 if (!NILP (insval)) 4306 inserted = XFASTINT (insval);
4308 {
4309 CHECK_NUMBER (insval, 0);
4310 inserted = XFASTINT (insval);
4311 }
4312 QUIT;
4313 p = Fcdr (p);
4314 } 4307 }
4308 QUIT;
4309 p = Fcdr (p);
4310 }
4311
4312 if (!NILP (visit)
4313 && current_buffer->modtime == -1)
4314 {
4315 /* If visiting nonexistent file, return nil. */
4316 report_file_error ("Opening input file", Fcons (orig_filename, Qnil));
4315 } 4317 }
4316 4318
4317 /* ??? Retval needs to be dealt with in all cases consistently. */ 4319 /* ??? Retval needs to be dealt with in all cases consistently. */