summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-compat.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-02-03 18:48:09 +0100
committerMichael Albinus <michael.albinus@gmx.de>2021-02-03 18:48:09 +0100
commitb81516c7fb558c9b4bc44e6e69f6729a5f2f9894 (patch)
tree28ecd524cd5e45fd4b792dfd9cc82843a0261ad6 /lisp/net/tramp-compat.el
parentbd5b4b35bc85b19f152e89e3945071ffc48c454d (diff)
downloademacs-b81516c7fb558c9b4bc44e6e69f6729a5f2f9894.tar.gz
emacs-b81516c7fb558c9b4bc44e6e69f6729a5f2f9894.tar.bz2
emacs-b81516c7fb558c9b4bc44e6e69f6729a5f2f9894.zip
Tramp code cleanup
* lisp/net/tramp.el (tramp-signal-hook-function) (tramp-handle-access-file, tramp-handle-copy-directory) (tramp-handle-directory-files, tramp-handle-file-local-copy) (tramp-handle-insert-file-contents, tramp-handle-load): * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes) (tramp-adb-handle-make-directory) (tramp-adb-handle-file-local-copy, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-crypt.el (tramp-crypt-do-copy-or-rename-file) (tramp-crypt-handle-directory-files) (tramp-crypt-handle-make-directory): * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-error) (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-make-directory): * lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file) (tramp-rclone-handle-directory-files): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-directory-files-and-attributes) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-make-directory) (tramp-sh-handle-file-local-copy) (tramp-sh-inotifywait-process-filter): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file, tramp-smb-handle-directory-files) (tramp-smb-handle-file-local-copy) (tramp-smb-handle-make-directory, tramp-smb-handle-rename-file): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file): Unify error report. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Sync args with other `tramp-*-file-name-handler'. * lisp/net/tramp-compat.el (tramp-error): Declare. (tramp-compat-file-missing): New defsubst. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): Handle volatile files. (tramp-gvfs-set-attribute): New defun. (tramp-gvfs-handle-set-file-modes) (tramp-gvfs-handle-set-file-times) (tramp-gvfs-handle-set-file-uid-gid): Use it. * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): Use `msg-operation'. * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory): Remove superfluous `format: (tramp-smb-maybe-open-connection): Simplify loop. * lisp/net/tramp.el (tramp-handle-file-truename): Drop volume letter from symlinked files. * test/lisp/net/tramp-tests.el (tramp--test-gdrive-p): New defun. (tramp--test-nextcloud-p): Remove. (tramp-test40-special-characters-with-ls): Do not skip on MS Windows. (tramp-test41-utf8): Skip if needed.
Diffstat (limited to 'lisp/net/tramp-compat.el')
-rw-r--r--lisp/net/tramp-compat.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 87e5378e807..27461e6917c 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -41,6 +41,7 @@
(require 'shell)
(require 'subr-x)
+(declare-function tramp-error "tramp")
;; `temporary-file-directory' as function is introduced with Emacs 26.1.
(declare-function tramp-handle-temporary-file-directory "tramp")
(declare-function tramp-tramp-file-p "tramp")
@@ -178,6 +179,12 @@ This is a string of ten letters or dashes as in ls -l."
(if (get 'file-missing 'error-conditions) 'file-missing 'file-error)
"The error symbol for the `file-missing' error.")
+(defsubst tramp-compat-file-missing (vec file)
+ "Emit the `file-missing' error."
+ (if (get 'file-missing 'error-conditions)
+ (tramp-error vec tramp-file-missing file)
+ (tramp-error vec tramp-file-missing "No such file or directory: %s" file)))
+
;; `file-local-name', `file-name-quoted-p', `file-name-quote' and
;; `file-name-unquote' are introduced in Emacs 26.1.
(defalias 'tramp-compat-file-local-name