]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor Tramp fixes
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 27 May 2023 08:14:50 +0000 (10:14 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 27 May 2023 08:14:50 +0000 (10:14 +0200)
* lisp/net/tramp-sh.el (tramp-sh-handle-process-file): Set `env'
explicitly.
(tramp-barf-if-no-shell-prompt): Still add optional trailing
`ansi-color-control-seq-regexp'.

* lisp/net/tramp.el (tramp-make-tramp-file-name): Keep hop while
in file name completion.

* test/lisp/net/tramp-tests.el
(tramp-test26-interactive-file-name-completion): Adapt test.

lisp/net/tramp-sh.el
lisp/net/tramp.el
test/lisp/net/tramp-tests.el

index 25a26d67d6d784c71697ecc123b3b3de3592b2a8..fb8112c384d33f78856c2b3a790bc725fd611a44 100644 (file)
@@ -3127,7 +3127,7 @@ implementation will be used."
             (if (tramp-compat-string-search "=" elt)
                 (setq env (append env `(,elt)))
               (setq uenv (cons elt uenv)))))
-      (setenv-internal env "INSIDE_EMACS" (tramp-inside-emacs) 'keep)
+      (setq env (setenv-internal env "INSIDE_EMACS" (tramp-inside-emacs) 'keep))
       (when env
        (setq command
              (format
@@ -4316,6 +4316,7 @@ seconds.  If not, it produces an error message with the given ERROR-ARGS."
         proc timeout
         (rx
          (| (regexp shell-prompt-pattern) (regexp tramp-shell-prompt-pattern))
+         (? (regexp ansi-color-control-seq-regexp))
          eos))
       (error
        (delete-process proc)
index 3ceb20f263473c0034852b090bdab4518de4af08..ecc950adfde76eebe21a8b9e0b70d823b7fae20b 100644 (file)
@@ -1802,7 +1802,9 @@ the form (METHOD USER DOMAIN HOST PORT LOCALNAME &optional HOP)."
       (when (cadr args)
        (setq localname (and (stringp (cadr args)) (cadr args))))
       (when hop
-       (setq hop nil)
+       ;; Keep hop in file name for completion.
+       (unless minibuffer-completing-file-name
+         (setq hop nil))
        ;; Assure that the hops are in `tramp-default-proxies-alist'.
        ;; In tramp-archive.el, the slot `hop' is used for the archive
        ;; file name.
@@ -5720,7 +5722,7 @@ See `tramp-process-actions' for the format of ACTIONS."
       ;; Obviously, the output was not complete.
       (while (tramp-accept-process-output proc))
       ;; Remove ANSI control escape sequences.
-      (with-current-buffer  (tramp-get-connection-buffer vec)
+      (with-current-buffer (tramp-get-connection-buffer vec)
        (goto-char (point-min))
        (while (re-search-forward ansi-color-control-seq-regexp nil t)
          (replace-match "")))
index eec4a66a32995866d8e03ff8cee3b7f4bec1f29b..017cb73f3bbf1535c07e3405174c752585c80e2d 100644 (file)
@@ -4749,7 +4749,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                              tramp-prefix-format hop
                              (substring-no-properties
                              method 0 (min 2 (length method))))
-                          ,(concat tramp-prefix-format method-string)
+                          ,(concat tramp-prefix-format hop method-string)
                           ,method-string)))
                      ;; Complete user name.
                      (unless (tramp-string-empty-or-nil-p user)
@@ -4758,7 +4758,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                              (substring-no-properties
                              user 0 (min 2 (length user))))
                           ,(concat
-                             tramp-prefix-format method-string user-string)
+                             tramp-prefix-format hop method-string user-string)
                           ,user-string)))
                      ;; Complete host name.
                      (unless (tramp-string-empty-or-nil-p host)
@@ -4768,9 +4768,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                             (substring-no-properties
                              host 0 (min 2 (length host))))
                           (,(concat
-                             tramp-prefix-format method-string host-string)
+                             tramp-prefix-format hop method-string host-string)
                            ,(concat
-                             tramp-prefix-format method-string
+                             tramp-prefix-format hop method-string
                              user-string host-string))
                           ,host-string)))
                      ;; Complete user and host name.
@@ -4782,7 +4782,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                             (substring-no-properties
                              host 0 (min 2 (length host))))
                           ,(concat
-                             tramp-prefix-format method-string
+                             tramp-prefix-format hop method-string
                             user-string host-string)
                           ,host-string)))))