summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-sudoedit.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2023-02-18 18:27:56 +0100
committerMichael Albinus <michael.albinus@gmx.de>2023-02-18 18:27:56 +0100
commit2ac8d7e64a08ea6e22bb90ad16e2880440fbcf16 (patch)
tree707d87bff3751bf849a6fe1b4c777e9523282592 /lisp/net/tramp-sudoedit.el
parentb3502b922821fd100fb86b8cda6a0a62fba7d394 (diff)
downloademacs-2ac8d7e64a08ea6e22bb90ad16e2880440fbcf16.tar.gz
Improve Tramp's user and host name completion
* lisp/net/tramp.el (tramp-completion-handle-file-exists-p): Improve user name completion. (tramp-skeleton-file-exists-p): New defmacro, which also handles host name completion. (tramp-handle-file-exists-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-exists-p): * lisp/net/tramp-sh.el (tramp-sh-handle-file-exists-p): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-exists-p): Use it.
Diffstat (limited to 'lisp/net/tramp-sudoedit.el')
-rw-r--r--lisp/net/tramp-sudoedit.el13
1 files changed, 3 insertions, 10 deletions
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index 1f646253579..fa1689d6851 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -454,16 +454,9 @@ the result will be a local, non-Tramp, file name."
(defun tramp-sudoedit-handle-file-exists-p (filename)
"Like `file-exists-p' for Tramp files."
- ;; `file-exists-p' is used as predicate in file name completion.
- ;; We don't want to run it when `non-essential' is t, or there is
- ;; no connection process yet.
- (when (tramp-connectable-p filename)
- (with-parsed-tramp-file-name (expand-file-name filename) nil
- (with-tramp-file-property v localname "file-exists-p"
- (if (tramp-file-property-p v localname "file-attributes")
- (not (null (tramp-get-file-property v localname "file-attributes")))
- (tramp-sudoedit-send-command
- v "test" "-e" (file-name-unquote localname)))))))
+ (tramp-skeleton-file-exists-p filename
+ (tramp-sudoedit-send-command
+ v "test" "-e" (file-name-unquote localname))))
(defun tramp-sudoedit-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for Tramp files."