summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-sudoedit.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2023-03-12 17:21:57 +0100
committerMichael Albinus <michael.albinus@gmx.de>2023-03-12 17:21:57 +0100
commitf5f13495f5dac4148c1da8b0ba18c22daf77bb04 (patch)
treedf1f722b4801b8f8fd4c8900ede8a04728f5beef /lisp/net/tramp-sudoedit.el
parente87431eda0a73c15865deb554cdb3ba13b7767f6 (diff)
downloademacs-f5f13495f5dac4148c1da8b0ba18c22daf77bb04.tar.gz
Make Tramp file name completion more quiet for all backends
* lisp/net/tramp-adb.el (tramp-adb-handle-file-name-all-completions): * lisp/net/tramp-archive.el (tramp-archive-handle-file-name-all-completions): * lisp/net/tramp-crypt.el (tramp-crypt-handle-file-name-all-completions): * lisp/net/tramp-fuse.el (tramp-fuse-handle-file-name-all-completions): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-name-all-completions): * lisp/net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-name-all-completions): Return nil when DIRECTORY is missing. (Bug#61890)
Diffstat (limited to 'lisp/net/tramp-sudoedit.el')
-rw-r--r--lisp/net/tramp-sudoedit.el39
1 files changed, 20 insertions, 19 deletions
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index fa1689d6851..abb9afc570b 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -460,26 +460,27 @@ the result will be a local, non-Tramp, file name."
(defun tramp-sudoedit-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for Tramp files."
- (all-completions
- filename
- (with-parsed-tramp-file-name (expand-file-name directory) nil
- (with-tramp-file-property v localname "file-name-all-completions"
- (tramp-sudoedit-send-command
- v "ls" "-a1" "--quoting-style=literal" "--show-control-chars"
- (if (tramp-string-empty-or-nil-p localname)
- "" (file-name-unquote localname)))
- (mapcar
- (lambda (f)
- (if (ignore-errors (file-directory-p (expand-file-name f directory)))
- (file-name-as-directory f)
- f))
- (delq
- nil
+ (ignore-error file-missing
+ (all-completions
+ filename
+ (with-parsed-tramp-file-name (expand-file-name directory) nil
+ (with-tramp-file-property v localname "file-name-all-completions"
+ (tramp-sudoedit-send-command
+ v "ls" "-a1" "--quoting-style=literal" "--show-control-chars"
+ (if (tramp-string-empty-or-nil-p localname)
+ "" (file-name-unquote localname)))
(mapcar
- (lambda (l) (and (not (string-match-p (rx bol (* blank) eol) l)) l))
- (split-string
- (tramp-get-buffer-string (tramp-get-connection-buffer v))
- "\n" 'omit))))))))
+ (lambda (f)
+ (if (ignore-errors (file-directory-p (expand-file-name f directory)))
+ (file-name-as-directory f)
+ f))
+ (delq
+ nil
+ (mapcar
+ (lambda (l) (and (not (string-match-p (rx bol (* blank) eol) l)) l))
+ (split-string
+ (tramp-get-buffer-string (tramp-get-connection-buffer v))
+ "\n" 'omit)))))))))
(defun tramp-sudoedit-handle-file-readable-p (filename)
"Like `file-readable-p' for Tramp files."