unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33364: 26.1.50; Tramp doesn't parse multiple hosts on a single line correctly
@ 2018-11-13 11:01 Christian Schwarzgruber
  2018-11-14 13:54 ` Michael Albinus
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Schwarzgruber @ 2018-11-13 11:01 UTC (permalink / raw)
  To: 33364

Hello Everyone!

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.

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 :-.

Thanks!

Christian





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#33364: 26.1.50; Tramp doesn't parse multiple hosts on a single line correctly
  2018-11-13 11:01 bug#33364: 26.1.50; Tramp doesn't parse multiple hosts on a single line correctly Christian Schwarzgruber
@ 2018-11-14 13:54 ` Michael Albinus
       [not found]   ` <FED26101-B041-4EE2-AD59-EA9DD3E54473@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Albinus @ 2018-11-14 13:54 UTC (permalink / raw)
  To: Christian Schwarzgruber; +Cc: 33364

Christian Schwarzgruber <c.schwarzgruber.cs@gmail.com> 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.





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#33364: 26.1.50; Tramp doesn't parse multiple hosts on a single line correctly
       [not found]   ` <FED26101-B041-4EE2-AD59-EA9DD3E54473@gmail.com>
@ 2018-11-14 15:22     ` Michael Albinus
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Albinus @ 2018-11-14 15:22 UTC (permalink / raw)
  To: Christian Schwarzgruber; +Cc: 33364-done

Version: 26.2

Christian Schwarzgruber <c.schwarzgruber.cs@gmail.com> writes:

> Hey Michael! 

Hi Christian,

[Pls keep the Cc, for the archives]

> Works, Great 👌

Thanks for the feedback. I've fixed this in the emacs-26 branch, closing
the bug.

> Thanks! 
>
> regards
> Christian

Best regards, Michael.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-14 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-13 11:01 bug#33364: 26.1.50; Tramp doesn't parse multiple hosts on a single line correctly Christian Schwarzgruber
2018-11-14 13:54 ` Michael Albinus
     [not found]   ` <FED26101-B041-4EE2-AD59-EA9DD3E54473@gmail.com>
2018-11-14 15:22     ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).