unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: "Bartosz Kaczyński" <bk@asterio.cloud>
Cc: 54885@debbugs.gnu.org
Subject: bug#54885: 29.0.50; Tramp completion support for top-level sshconfig include
Date: Wed, 13 Apr 2022 16:44:20 +0200	[thread overview]
Message-ID: <87tuaxm4aj.fsf@gmx.de> (raw)
In-Reply-To: <87y209mp54.fsf@gmx.de> (Michael Albinus's message of "Wed, 13 Apr 2022 09:13:59 +0200")

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Bartosz,

> Tramp doesn't handle sshconfig includes. However, you can emulate it
> yourself with the following snippet in your .emacs (untested):

Hmm, there was an error in the snipptet. I've reworked it, and added to
the Tramp manual (pushed to master):

--8<---------------cut here---------------start------------->8---
4.18.1 Using ssh config include for host name completion
--------------------------------------------------------

OpenSSH configuration files can use an ‘Include’ option for further
configuration files.  Default TRAMP host name completion ignores this
option.  However, you can configure this yourself.

   Given, your ‘~/.ssh/config’ file contains the following option:

     Include ~/.ssh/conf.d/*

   The following code snippet in your ‘.emacs’ uses all files in that
directory for host name completion:

     (tramp-set-completion-function
      "ssh" (append (tramp-get-completion-function "ssh")
                    (mapcar (lambda (file) `(tramp-parse-sconfig ,file))
                            (directory-files
                             "~/.ssh/conf.d/"
                             'full directory-files-no-dot-files-regexp))))

   This code snippet does it for the ‘ssh’ method.  If you replace
"ssh" by "scp", it does it also for that method (or any other method
you like).
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.





  reply	other threads:[~2022-04-13 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 13:53 bug#54885: 29.0.50; Tramp completion support for top-level sshconfig include Bartosz Kaczyński
2022-04-13  7:13 ` Michael Albinus
2022-04-13 14:44   ` Michael Albinus [this message]
2022-04-13 15:22     ` Bartosz Kaczyński
2022-04-13 15:29       ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tuaxm4aj.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=54885@debbugs.gnu.org \
    --cc=bk@asterio.cloud \
    /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 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).