1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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>
This commit is contained in:
Paul Eggert 2016-10-21 13:04:02 -07:00
parent 76b08a35bb
commit 897998291f
14 changed files with 64 additions and 43 deletions

View file

@ -1533,12 +1533,11 @@ then kill the related FTP process."
(defun ange-ftp-barf-if-not-directory (directory)
(or (file-directory-p directory)
(signal 'file-error
(list "Opening directory"
(if (file-exists-p directory)
"Not a directory"
"No such file or directory")
directory))))
(let ((exists (file-exists-p directory)))
(signal (if exists 'file-error 'file-missing)
(list "Opening directory"
(if exists "Not a directory" "No such file or directory")
directory)))))
;;;; ------------------------------------------------------------
;;;; FTP process filter support.
@ -3352,9 +3351,10 @@ system TYPE.")
(setq buffer-file-name filename)))
(setq last-coding-system-used coding-system-used)
(list filename size))
(signal 'file-error
(signal 'file-missing
(list
"Opening input file"
"No such file or directory"
filename))))
(ange-ftp-real-insert-file-contents filename visit beg end replace))))
@ -3663,7 +3663,7 @@ so return the size on the remote host exactly. See RFC 3659."
newname (expand-file-name newname))
(or (file-exists-p filename)
(signal 'file-error
(signal 'file-missing
(list "Copy file" "No such file or directory" filename)))
;; canonicalize newname if a directory.