From: Michael Albinus Date: Thu, 22 Feb 2018 10:49:07 +0000 (+0100) Subject: Fix Bug#30533 X-Git-Tag: emacs-27.0.90~5645 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=130c1b8e0e94e7f309db54e440a73cb15a2c8ab6;p=emacs.git Fix Bug#30533 * lisp/net/ange-ftp.el (ange-ftp-file-regular-p) (ange-ftp-real-file-regular-p): New defuns. (Bug#30533) --- diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index f5a5474e889..b1e0bf24aa8 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3373,6 +3373,13 @@ system TYPE.") (file-error nil)) (ange-ftp-real-file-symlink-p file))) +(defun ange-ftp-file-regular-p (file) + ;; Reuse Tramp's implementation. + (if (ange-ftp-ftp-name file) + (and (file-exists-p file) + (eq ?- (aref (file-attribute-modes (file-attributes file)) 0))) + (ange-ftp-real-file-regular-p file))) + (defun ange-ftp-file-exists-p (name) (setq name (expand-file-name name)) (if (ange-ftp-ftp-name name) @@ -4395,6 +4402,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") (put 'file-readable-p 'ange-ftp 'ange-ftp-file-readable-p) (put 'file-executable-p 'ange-ftp 'ange-ftp-file-executable-p) (put 'file-symlink-p 'ange-ftp 'ange-ftp-file-symlink-p) +(put 'file-regular-p 'ange-ftp 'ange-ftp-file-regular-p) (put 'delete-file 'ange-ftp 'ange-ftp-delete-file) (put 'verify-visited-file-modtime 'ange-ftp 'ange-ftp-verify-visited-file-modtime) @@ -4485,6 +4493,8 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") (ange-ftp-run-real-handler 'file-executable-p args)) (defun ange-ftp-real-file-symlink-p (&rest args) (ange-ftp-run-real-handler 'file-symlink-p args)) +(defun ange-ftp-real-file-regular-p (&rest args) + (ange-ftp-run-real-handler 'file-regular-p args)) (defun ange-ftp-real-delete-file (&rest args) (ange-ftp-run-real-handler 'delete-file args)) (defun ange-ftp-real-verify-visited-file-modtime (&rest args)