aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2016-10-21 13:04:02 -0700
committerPaul Eggert2016-10-21 13:06:03 -0700
commit897998291fd09c3b9825a07045fa05f17bf83875 (patch)
tree03ab8a82b587c32e32d94744195dba07e5ce71ca /src
parent76b08a35bb6b3b32e5e5fda53e374769ceae6ed8 (diff)
downloademacs-897998291fd09c3b9825a07045fa05f17bf83875.tar.gz
emacs-897998291fd09c3b9825a07045fa05f17bf83875.zip
New error file-missing
This fixes a recently-introduced bug in delete-directory, where the code assumes the C locale when determining whether a file-error corresponds to a missing file (Bug#24714). * doc/lispref/errors.texi (Standard Errors): * doc/lispref/files.texi (Changing Files): * etc/NEWS: Document this. * doc/lispref/loading.texi (How Programs Do Loading): Say "a file-error" rather than "the error file-error" since it might be a file-missing now. * lisp/emacs-lisp/bytecomp.el (byte-compile-file): * lisp/epa-file.el (epa-file--find-file-not-found-function): (epa-file-insert-file-contents, epa-file-write-region): * lisp/ffap.el (find-file-at-point, dired-at-point): * lisp/jka-compr.el (jka-compr-insert-file-contents) (jka-compr-insert-file-contents): * lisp/net/ange-ftp.el (ange-ftp-barf-if-not-directory) (ange-ftp-insert-file-contents, ange-ftp-copy-file-internal): * lisp/progmodes/etags.el (visit-tags-table): * lisp/url/url-handlers.el (url-copy-file): * src/fileio.c (report_file_errno): Signal file-missing if appropriate. * lisp/epa-file.el (epa-file-insert-file-contents): * lisp/jka-compr.el (jka-compr-insert-file-contents): Don't assume file-error is a leaf in the error hierarchy. * lisp/files.el (files--force): * lisp/gnus/nnmaildir.el (nnmaildir--enoent-p): * lisp/jka-compr.el (jka-compr-insert-file-contents): Use file-missing to detect whether the file is missing. * lisp/url/url-handlers.el (url-copy-file): Signal file-already-exists if appropriate. * src/fileio.c (syms_of_fileio): Define file-missing. 2016-10-18 Paul Eggert <eggert@cs.ucla.edu>
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 6026d8ebad4..ea6e4aef9be 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -203,7 +203,8 @@ report_file_errno (char const *string, Lisp_Object name, int errorno)
203 if (errorno == EEXIST) 203 if (errorno == EEXIST)
204 xsignal (Qfile_already_exists, errdata); 204 xsignal (Qfile_already_exists, errdata);
205 else 205 else
206 xsignal (Qfile_error, Fcons (build_string (string), errdata)); 206 xsignal (errorno == ENOENT ? Qfile_missing : Qfile_error,
207 Fcons (build_string (string), errdata));
207} 208}
208 209
209/* Signal a file-access failure that set errno. STRING describes the 210/* Signal a file-access failure that set errno. STRING describes the
@@ -5874,6 +5875,7 @@ syms_of_fileio (void)
5874 DEFSYM (Qfile_error, "file-error"); 5875 DEFSYM (Qfile_error, "file-error");
5875 DEFSYM (Qfile_already_exists, "file-already-exists"); 5876 DEFSYM (Qfile_already_exists, "file-already-exists");
5876 DEFSYM (Qfile_date_error, "file-date-error"); 5877 DEFSYM (Qfile_date_error, "file-date-error");
5878 DEFSYM (Qfile_missing, "file-missing");
5877 DEFSYM (Qfile_notify_error, "file-notify-error"); 5879 DEFSYM (Qfile_notify_error, "file-notify-error");
5878 DEFSYM (Qexcl, "excl"); 5880 DEFSYM (Qexcl, "excl");
5879 5881
@@ -5926,6 +5928,11 @@ behaves as if file names were encoded in `utf-8'. */);
5926 Fput (Qfile_date_error, Qerror_message, 5928 Fput (Qfile_date_error, Qerror_message,
5927 build_pure_c_string ("Cannot set file date")); 5929 build_pure_c_string ("Cannot set file date"));
5928 5930
5931 Fput (Qfile_missing, Qerror_conditions,
5932 Fpurecopy (list3 (Qfile_missing, Qfile_error, Qerror)));
5933 Fput (Qfile_missing, Qerror_message,
5934 build_pure_c_string ("File is missing"));
5935
5929 Fput (Qfile_notify_error, Qerror_conditions, 5936 Fput (Qfile_notify_error, Qerror_conditions,
5930 Fpurecopy (list3 (Qfile_notify_error, Qfile_error, Qerror))); 5937 Fpurecopy (list3 (Qfile_notify_error, Qfile_error, Qerror)));
5931 Fput (Qfile_notify_error, Qerror_message, 5938 Fput (Qfile_notify_error, Qerror_message,