From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#60505: 29.0.60; Fido Mode and Tramp Completion Date: Fri, 03 Feb 2023 00:23:21 +0000 Message-ID: References: <87k024918k.fsf@jroy.ca> <8dea9f3e0e411c315b04@heytings.org> <87tu15m6g7.fsf@gmx.de> <8dea9f3e0eb47ac9e4ab@heytings.org> <371ba1d0be1f14c7c798@heytings.org> <8aadf0ddd54d67a3213d@heytings.org> <87a62jmwj6.fsf@gmx.de> <87o7qwm3dd.fsf@gmx.de> <43562d4dd9c31382eb40@heytings.org> <87k011dtw2.fsf@gmx.de> <43562d4dd93037f7d01f@heytings.org> <834js4zi69.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14633"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60505@debbugs.gnu.org, michael.albinus@gmx.de, Stefan Monnier , julien@jroy.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 03 01:24:15 2023 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 1pNjsE-0003bj-Dp for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Feb 2023 01:24:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNjs4-0002Rm-1N; Thu, 02 Feb 2023 19:24:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNjs2-0002QA-52 for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 19:24:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNjs1-0004ww-Sx for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 19:24:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNjs1-0002fm-IE for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 19:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Feb 2023 00:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60505 X-GNU-PR-Package: emacs Original-Received: via spool by 60505-submit@debbugs.gnu.org id=B60505.167538380410228 (code B ref 60505); Fri, 03 Feb 2023 00:24:01 +0000 Original-Received: (at 60505) by debbugs.gnu.org; 3 Feb 2023 00:23:24 +0000 Original-Received: from localhost ([127.0.0.1]:36180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNjrP-0002et-VO for submit@debbugs.gnu.org; Thu, 02 Feb 2023 19:23:24 -0500 Original-Received: from heytings.org ([95.142.160.155]:41072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNjrO-0002ek-F9 for 60505@debbugs.gnu.org; Thu, 02 Feb 2023 19:23:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1675383801; bh=anGS9IUxOp35oi6fqrznLXGnmR7dailnDo4q3Hwells=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=Dtsw7/9omC+5VoO5mERrGQsAu+RULyoou2wtVt5B82aYqN4HuQ/Knd4JaQzjgj3dY TwJq+DVstCoo9GN40o8o0w2A1OFTcDeHnA/L28yf+J4xIRNy734tElFvPl8ffytAkD mAqWZ8bowJgIJ0ShCJci6mQIUIrGkmL7sKdEGbuoIlpJTVTsd/DQGlojZ8NdJX5HUY zwQo/V0PKHHeqrkR4H8r0oI9Tv/VPBHRQsKdRQTlwcY0G3HGh+rVBr71s35Xa6Cicv yfTtqxfxvxDos3aZnmYetTYHl26q25xXULeziW11jwkl20vgtGy/fMVSypVIFd614v 3wmBX7+gCjOfA== In-Reply-To: <834js4zi69.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254703 Archived-At: >> More importantly (as I unsuccessfully tried to convey) it circumvents >> the bug in the implementation of a particular completion mechanism, >> which is not the place where the bug lies and should be fixed. It is >> not reasonable to expect that all existing and future file completion >> mechanisms should implement specific rules to deal with the Tramp >> syntax (or, for that matter, with the syntax of any other package). > > From my POV, it is very reasonable to expect that completion mechanisms > know about Tramp syntax and support it. Tramp became long ago an > integral part of the Emacs core, so its syntax is as important to > support as any other syntactical aspects of file names in Emacs, such as > the "/:" "quoting". > The possibility that it would be necessary at some point to add an explicit support for the Tramp syntax(es) in the completion mechanisms cannot be ruled out, of course. But this bug (and the related ones) is not a reason to do that, because it can easily be fixed inside Tramp. Did you look at the options that are on the table? Option 1 is a trivial three-line patch to tramp.el, which adds a conditional around an existing statement to give users and modes control on the way Tramp methods are displayed (unconditionally with tramp-methods-in-completions t, lazily with tramp-methods-in-completions nil): diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 1916d50af03..ca08a0a2cd2 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -812,6 +812,8 @@ tramp-syntax :initialize #'custom-initialize-default :set #'tramp-set-syntax) +(defcustom tramp-methods-in-completions t) + (defvar tramp-prefix-format) (defvar tramp-prefix-regexp) (defvar tramp-method-regexp) @@ -3022,8 +3024,10 @@ tramp-completion-handle-file-name-all-completions (delq nil all-user-hosts))))) ;; Possible methods. - (setq result - (append result (tramp-get-completion-methods m))))))) + (unless (and (string-empty-p method) + (not tramp-methods-in-completions)) + (setq result + (append result (tramp-get-completion-methods m)))))))) ;; Unify list, add hop, remove nil elements. (dolist (elt result) Option 2 is a N-lines patch (which doesn't exist yet) to minibuffer.el (and possibly other files) to add support for the Tramp syntax in completions mechanisms. Option 3, 4, 5 and 6 were suggested by Stefan in his last three posts: change the completion-table API, make Tramp teach the rest of the system that its methods are a kind of directory, change Tramp's syntax from e.g. '/ssh:' to '/ssh/', introduce a new set of completion file name functions. I have no idea how complex any of these solutions are, but it's clear that none of them can be implemented easily.