diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2020-03-09 16:05:21 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2020-03-09 16:05:21 +0100 |
commit | a1e2a6847007f56d96d0122e493d5228e5c4d08b (patch) | |
tree | aca427daf304376b8745446c4ba26252a0f7b98c /lisp/net/tramp-compat.el | |
parent | a461baae79af3cea8780e9d9a845a1e859e96e5e (diff) | |
download | emacs-a1e2a6847007f56d96d0122e493d5228e5c4d08b.tar.gz emacs-a1e2a6847007f56d96d0122e493d5228e5c4d08b.tar.bz2 emacs-a1e2a6847007f56d96d0122e493d5228e5c4d08b.zip |
Finish implementation of set-file-times FLAG arg in Tramp
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
Implement FLAG.
(tramp-adb-handle-copy-file): Adapt `set-file-times' call.
* lisp/net/tramp-compat.el (tramp-compat-set-file-times): New defalias.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-modes)
(tramp-gvfs-handle-set-file-times, tramp-gvfs-set-file-uid-gid):
Simplify `tramp-gvfs-url-file-name' call.
* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times): Implement FLAG.
(tramp-do-copy-or-rename-file-via-buffer)
(tramp-do-copy-or-rename-file-out-of-band): Add optional argument
OK-IF-ALREADY-EXISTS. Adapt callees.
(tramp-do-copy-or-rename-file-via-buffer)
(tramp-do-copy-or-rename-file-directly)
(tramp-do-copy-or-rename-file-out-of-band): Adapt `set-file-times' call.
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-copy-file): Adapt `set-file-times' call.
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
Adapt `set-file-times' call.
(tramp-sudoedit-handle-set-file-times): Implement FLAG.
* test/lisp/net/tramp-tests.el (tramp-test22-file-times): Extend test.
Diffstat (limited to 'lisp/net/tramp-compat.el')
-rw-r--r-- | lisp/net/tramp-compat.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 8f85550bca0..f0131d59852 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -276,7 +276,8 @@ A nil value for either argument stands for the current time." (lambda (reporter &optional value _suffix) (progress-reporter-update reporter value)))) -;; `file-modes' and `set-file-modes' got argument FLAG in Emacs 28.1. +;; `file-modes', `set-file-modes' and `set-file-times' got argument +;; FLAG in Emacs 28.1. (defalias 'tramp-compat-file-modes (if (equal (tramp-compat-funcall 'func-arity #'file-modes) '(1 . 2)) #'file-modes @@ -289,6 +290,12 @@ A nil value for either argument stands for the current time." (lambda (filename mode &optional _flag) (set-file-modes filename mode)))) +(defalias 'tramp-compat-set-file-times + (if (equal (tramp-compat-funcall 'func-arity #'set-file-times) '(1 . 3)) + #'set-file-times + (lambda (filename &optional timestamp _flag) + (set-file-times filename timestamp)))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-loaddefs 'force) |