bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33364: 26.1.50; Tramp doesn't parse multiple hosts on a single line


From: Michael Albinus
Subject: bug#33364: 26.1.50; Tramp doesn't parse multiple hosts on a single line correctly
Date: Wed, 14 Nov 2018 14:54:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Christian Schwarzgruber <address@hidden> writes:

> Hello Everyone!

Hi Christian,

> When, e.g. I put this "Host a b c d" into "~/.ssh/config" Emacs tramp
> completion only suggests host "a" instead of host "a", "b", "c" and "d". But
> "Host a b c d" is a valid syntax, bash completion offers all four hosts for
> instance.

Indeed.

> Adding " " to `tramp-host-regexp` doesn't solve the problem as it would result
> in a host "a b c d", which is not what I wanted :-.

The following patch solves this for me:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/tramp.el b/lisp/tramp.el
index 179a2c46..eb994c81 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -2922,7 +2922,9 @@ User is always nil."
    "Return a (user host) tuple allowed to access.
 User is always nil."
    (tramp-parse-group
-    (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)") 1 ","))
+    (concat "\\(?:^[ \t]*Host\\)" "\\|" "\\(?:^.+\\)"
+           "\\|" "\\(" tramp-host-regexp "\\)")
+    1 "[ \t]+"))
 
 ;; Generic function.
 (defun tramp-parse-shostkeys-sknownhosts (dirname regexp)
--8<---------------cut here---------------end--------------->8---

I've made it towards the master branch, but the patch shall also apply
towards the emacs-26 branch.

Could you pls check whether it works for you?

> Thanks!
>
> Christian

Best regards, Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]