From: Michael Albinus <michael.albinus@gmx.de>
To: Christian Schwarzgruber <c.schwarzgruber.cs@gmail.com>
Cc: 33364@debbugs.gnu.org
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 [thread overview]
Message-ID: <87muqbwyrg.fsf@gmx.de> (raw)
In-Reply-To: <B49FC632-AD71-4543-A41C-B2238ED3407D@gmail.com> (Christian Schwarzgruber's message of "Tue, 13 Nov 2018 12:01:06 +0100")
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.
next prev parent reply other threads:[~2018-11-14 13:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
[not found] ` <FED26101-B041-4EE2-AD59-EA9DD3E54473@gmail.com>
2018-11-14 15:22 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87muqbwyrg.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=33364@debbugs.gnu.org \
--cc=c.schwarzgruber.cs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.