all messages for Emacs-related lists mirrored at yhetil.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 09:13:59 +0200	[thread overview]
Message-ID: <87y209mp54.fsf@gmx.de> (raw)
In-Reply-To: <2404f136-515e-d017-72ac-0391bd5abcb6@asterio.cloud> ("Bartosz Kaczyński"'s message of "Tue, 12 Apr 2022 15:53:08 +0200")

Bartosz Kaczyński <bk@asterio.cloud> writes:

Hi Bartosz,

> Hi, I noticed that TRAMP hostname complation doesn't support my
> top-level sshconfig like below:
>
> tree ~/.ssh/conf.d/
> /home/bk/.ssh/conf.d/
> ├── domainX
> ├── domainY
> └── personal
>
> My ~/.ssh/config contains only one line
>
> Include conf.d/*
>
> and it's work perfectly from the shell by Emacs can't parse this
> Include directive. It would be very useful enhancement if the built-in
> completion frameworks (I use icomplete with vertical mode) can handle
> that structure which I first saw on counsel-tramp package(1).
>
> 1. https://github.com/masasam/emacs-counsel-tramp#support-for-top-level-sshconfig-include

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

--8<---------------cut here---------------start------------->8---
(defvar my-tramp-completion-function-alist-ssh nil)

(dolist (file (directory-files "~/.ssh/conf.d/" 'full directory-files-no-dot-files-regexp))
  (add-to-list 'my-tramp-completion-function-alist-ssh
	       `(tramp-parse-sconfig ,file)))

(tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh)
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.





  reply	other threads:[~2022-04-13  7:13 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 [this message]
2022-04-13 14:44   ` Michael Albinus
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

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

  git send-email \
    --in-reply-to=87y209mp54.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 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.