summaryrefslogtreecommitdiff
path: root/test/lisp/net/tramp-tests.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2023-02-10 17:48:44 +0100
committerMichael Albinus <michael.albinus@gmx.de>2023-02-10 17:48:44 +0100
commitea29622e928f50522e424ee59b0f24bbb5a42eca (patch)
treea77189ee0405190966c123a990de96306773923a /test/lisp/net/tramp-tests.el
parentab7c2f809219b0c29e7ee2b5ac66f18b0e657080 (diff)
downloademacs-ea29622e928f50522e424ee59b0f24bbb5a42eca.tar.gz
Fix Tramp file name completion
* lisp/net/tramp.el (tramp-completion-handle-expand-file-name): Reimplement. It must also work for the non-Tramp case. * test/lisp/net/tramp-tests.el (tramp-test26-interactive-file-name-completion): Fix test.
Diffstat (limited to 'test/lisp/net/tramp-tests.el')
-rw-r--r--test/lisp/net/tramp-tests.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index eea59843d47..a9f22369231 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4695,7 +4695,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
tramp-prefix-format
(substring-no-properties method 0 2))
unread-command-events
- (mapcar #'identity (concat test "\t\n"))
+ (mapcar #'identity (concat test "\t\t\n"))
completions nil
result (read-file-name "Prompt: "))
(if (not (get-buffer "*Completions*"))
@@ -4708,6 +4708,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(concat tramp-prefix-format method-string)
result)))
(with-current-buffer "*Completions*"
+ ;; We must remove leading `default-directory'.
+ (goto-char (point-min))
+ (let ((inhibit-read-only t))
+ (while (re-search-forward "//" nil 'noerror)
+ (delete-region (line-beginning-position) (point))))
+ (goto-char (point-min))
(re-search-forward
(rx bol (1+ nonl) "possible completions:" eol))
(forward-line 1)
@@ -4729,7 +4735,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
tramp-prefix-format method-string
(substring-no-properties host 0 2))
unread-command-events
- (mapcar #'identity (concat test "\t\n"))
+ (mapcar #'identity (concat test "\t\t\n"))
completions nil
result (read-file-name "Prompt: "))
(if (not (get-buffer "*Completions*"))
@@ -4744,6 +4750,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
ipv6-prefix host ipv6-postfix tramp-postfix-host-format)
result)))
(with-current-buffer "*Completions*"
+ ;; We must remove leading `default-directory'.
+ (goto-char (point-min))
+ (let ((inhibit-read-only t))
+ (while (re-search-forward "//" nil 'noerror)
+ (delete-region (line-beginning-position) (point))))
+ (goto-char (point-min))
(re-search-forward
(rx bol (1+ nonl) "possible completions:" eol))
(forward-line 1)