From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bartosz =?UTF-8?Q?Kaczy=C5=84ski?= Newsgroups: gmane.emacs.bugs Subject: bug#54885: 29.0.50; Tramp completion support for top-level sshconfig include Date: Wed, 13 Apr 2022 17:22:09 +0200 Message-ID: <346df59f-123e-a194-f784-d291c3355f78@asterio.cloud> References: <2404f136-515e-d017-72ac-0391bd5abcb6@asterio.cloud> <87y209mp54.fsf@gmx.de> <87tuaxm4aj.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32899"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Cc: 54885@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 13 17:31:35 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neexy-0008OU-JH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Apr 2022 17:31:34 +0200 Original-Received: from localhost ([::1]:48694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neexx-0006A2-KQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Apr 2022 11:31:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neexU-00066i-4x for bug-gnu-emacs@gnu.org; Wed, 13 Apr 2022 11:31:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59774) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1neexT-0008Lw-SZ for bug-gnu-emacs@gnu.org; Wed, 13 Apr 2022 11:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1neexT-0006VY-PY for bug-gnu-emacs@gnu.org; Wed, 13 Apr 2022 11:31:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bartosz =?UTF-8?Q?Kaczy=C5=84ski?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Apr 2022 15:31:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54885 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 54885-submit@debbugs.gnu.org id=B54885.164986385824962 (code B ref 54885); Wed, 13 Apr 2022 15:31:03 +0000 Original-Received: (at 54885) by debbugs.gnu.org; 13 Apr 2022 15:30:58 +0000 Original-Received: from localhost ([127.0.0.1]:53665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neexN-0006UP-6k for submit@debbugs.gnu.org; Wed, 13 Apr 2022 11:30:58 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:63261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neep0-0006EK-04 for 54885@debbugs.gnu.org; Wed, 13 Apr 2022 11:22:18 -0400 Original-Received: (Authenticated sender: bk@asterio.cloud) by mail.gandi.net (Postfix) with ESMTPSA id 0A36C40005; Wed, 13 Apr 2022 15:22:10 +0000 (UTC) Content-Language: en-US In-Reply-To: <87tuaxm4aj.fsf@gmx.de> X-Mailman-Approved-At: Wed, 13 Apr 2022 11:30:54 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:229831 Archived-At: Hi Michael, thank you. These few lines made my work lot easier and it's huge improvement. Best regards, Bartosz. On 4/13/22 16:44, Michael Albinus wrote: > Michael Albinus 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.