changeset 22056:cc1d87834752

(Finsert_file_contents): Don't check non-regular files for a coding: specification.
author Richard M. Stallman <rms@gnu.org>
date Thu, 14 May 1998 03:54:50 +0000
parents 463eb85cd3e5
children 9b0a64c31e1c
files src/fileio.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Thu May 14 00:57:14 1998 +0000
+++ b/src/fileio.c	Thu May 14 03:54:50 1998 +0000
@@ -3368,7 +3368,8 @@
 
   /* Decide the coding-system of the file.  */
   {
-    Lisp_Object val = Qnil;
+    Lisp_Object val;
+    val = Qnil;
 
     if (!NILP (Vcoding_system_for_read))
       val = Vcoding_system_for_read;
@@ -3376,8 +3377,10 @@
       /* In REPLACE mode, we can use the same coding system
 	 that was used to visit the file.  */
       val = current_buffer->buffer_file_coding_system;
-    else
+    else if (! not_regular)
       {
+	/* Don't try looking inside a file for a coding system specification
+	   if it is not seekable.  */
 	if (! NILP (Vset_auto_coding_function))
 	  {
 	    /* Find a coding system specified in the heading two lines
@@ -3493,10 +3496,11 @@
 	  {
 	    Lisp_Object args[6], coding_systems;
 
-	    args[0] = Qinsert_file_contents, args[1] = orig_filename,
-	      args[2] = visit, args[3] = beg, args[4] = end, args[5] = replace;
+	    args[0] = Qinsert_file_contents, args[1] = orig_filename;
+	    args[2] = visit, args[3] = beg, args[4] = end, args[5] = replace;
 	    coding_systems = Ffind_operation_coding_system (6, args);
-	    if (CONSP (coding_systems)) val = XCONS (coding_systems)->car;
+	    if (CONSP (coding_systems))
+	      val = XCONS (coding_systems)->car;
 	  }
       }