diff src/fileio.c @ 71977:6299774acc49

(report_file_error): Use xsignal. (barf_or_query_if_file_exists, Fcopy_file, Fdelete_file) (Finsert_file_contents): Use xsignal2. (syms_of_fileio): Use list2, list3.
author Kim F. Storm <storm@cua.dk>
date Tue, 18 Jul 2006 13:27:48 +0000
parents 086c76517b02
children 8006b4a1c703 02e39decdc84 8a8e69664178
line wrap: on
line diff
--- a/src/fileio.c	Tue Jul 18 13:26:38 2006 +0000
+++ b/src/fileio.c	Tue Jul 18 13:27:48 2006 +0000
@@ -280,7 +280,7 @@
     switch (errorno)
       {
       case EEXIST:
-	Fsignal (Qfile_already_exists, Fcons (errstring, data));
+	xsignal (Qfile_already_exists, Fcons (errstring, data));
 	break;
       default:
 	/* System error messages are capitalized.  Downcase the initial
@@ -288,7 +288,7 @@
 	if (SREF (errstring, 1) != '/')
 	  SSET (errstring, 0, DOWNCASE (SREF (errstring, 0)));
 
-	Fsignal (Qfile_error,
+	xsignal (Qfile_error,
 		 Fcons (build_string (string), Fcons (errstring, data)));
       }
 }
@@ -2384,9 +2384,8 @@
   if (lstat (SDATA (encoded_filename), &statbuf) >= 0)
     {
       if (! interactive)
-	Fsignal (Qfile_already_exists,
-		 Fcons (build_string ("File already exists"),
-			Fcons (absname, Qnil)));
+	xsignal2 (Qfile_already_exists,
+		  build_string ("File already exists"), absname);
       GCPRO1 (absname);
       tem = format2 ("File %s already exists; %s anyway? ",
 		     absname, build_string (querystring));
@@ -2396,9 +2395,8 @@
 	tem = do_yes_or_no_p (tem);
       UNGCPRO;
       if (NILP (tem))
-	Fsignal (Qfile_already_exists,
-		 Fcons (build_string ("File already exists"),
-			Fcons (absname, Qnil)));
+	xsignal2 (Qfile_already_exists,
+		  build_string ("File already exists"), absname);
       if (statptr)
 	*statptr = statbuf;
     }
@@ -2500,9 +2498,8 @@
 	{
 	  /* Restore original attributes.  */
 	  SetFileAttributes (filename, attributes);
-	  Fsignal (Qfile_date_error,
-		   Fcons (build_string ("Cannot set file date"),
-			  Fcons (newname, Qnil)));
+	  xsignal2 (Qfile_date_error,
+		    build_string ("Cannot set file date"), newname);
 	}
       /* Restore original attributes.  */
       SetFileAttributes (filename, attributes);
@@ -2598,9 +2595,8 @@
 	  EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0);
 	  if (set_file_times (SDATA (encoded_newname),
 			      atime, mtime))
-	    Fsignal (Qfile_date_error,
-		     Fcons (build_string ("Cannot set file date"),
-			    Fcons (newname, Qnil)));
+	    xsignal2 (Qfile_date_error,
+		      build_string ("Cannot set file date"), newname);
 	}
     }
 
@@ -2696,9 +2692,9 @@
   GCPRO1 (filename);
   if (!NILP (Ffile_directory_p (filename))
       && NILP (Ffile_symlink_p (filename)))
-    Fsignal (Qfile_error,
- 	     Fcons (build_string ("Removing old name: is a directory"),
- 		    Fcons (filename, Qnil)));
+    xsignal2 (Qfile_error,
+	      build_string ("Removing old name: is a directory"),
+	      filename);
   UNGCPRO;
   filename = Fexpand_file_name (filename, Qnil);
 
@@ -3848,9 +3844,8 @@
 	goto notfound;
 
       if (! NILP (replace) || ! NILP (beg) || ! NILP (end))
-	Fsignal (Qfile_error,
-		 Fcons (build_string ("not a regular file"),
-			Fcons (orig_filename, Qnil)));
+	xsignal2 (Qfile_error,
+		  build_string ("not a regular file"), orig_filename);
     }
 #endif
 
@@ -4723,9 +4718,8 @@
 	}
 #endif /* CLASH_DETECTION */
       if (not_regular)
-	Fsignal (Qfile_error,
-		 Fcons (build_string ("not a regular file"),
-			Fcons (orig_filename, Qnil)));
+	xsignal2 (Qfile_error,
+		  build_string ("not a regular file"), orig_filename);
     }
 
   if (set_coding_system)
@@ -6630,19 +6624,17 @@
   staticpro (&Qcar_less_than_car);
 
   Fput (Qfile_error, Qerror_conditions,
-	Fcons (Qfile_error, Fcons (Qerror, Qnil)));
+	list2 (Qfile_error, Qerror));
   Fput (Qfile_error, Qerror_message,
 	build_string ("File error"));
 
   Fput (Qfile_already_exists, Qerror_conditions,
-	Fcons (Qfile_already_exists,
-	       Fcons (Qfile_error, Fcons (Qerror, Qnil))));
+	list3 (Qfile_already_exists, Qfile_error, Qerror));
   Fput (Qfile_already_exists, Qerror_message,
 	build_string ("File already exists"));
 
   Fput (Qfile_date_error, Qerror_conditions,
-	Fcons (Qfile_date_error,
-	       Fcons (Qfile_error, Fcons (Qerror, Qnil))));
+	list3 (Qfile_date_error, Qfile_error, Qerror));
   Fput (Qfile_date_error, Qerror_message,
 	build_string ("Cannot set file date"));