unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 60505@debbugs.gnu.org, michael.albinus@gmx.de,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	julien@jroy.ca
Subject: bug#60505: 29.0.60; Fido Mode and Tramp Completion
Date: Fri, 03 Feb 2023 00:23:21 +0000	[thread overview]
Message-ID: <b0bd26d378bd8c1fe2f7@heytings.org> (raw)
In-Reply-To: <834js4zi69.fsf@gnu.org>


>> 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.






  parent reply	other threads:[~2023-02-03  0:23 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 19:37 bug#60505: 29.0.60; Fido Mode and Tramp Completion Julien Roy
2023-01-03  8:56 ` Michael Albinus
2023-01-05 13:07 ` Gregory Heytings
2023-01-05 13:55   ` Michael Albinus
2023-01-05 14:14     ` Gregory Heytings
2023-01-06  9:51       ` Gregory Heytings
2023-01-14 21:37         ` Gregory Heytings
2023-01-15 19:23           ` Michael Albinus
2023-01-15 22:38             ` Gregory Heytings
2023-01-18 12:30               ` Michael Albinus
2023-02-01 18:12                 ` Gregory Heytings
2023-02-01 20:15                   ` Michael Albinus
2023-02-01 21:27                     ` Gregory Heytings
2023-02-02  6:37                       ` Eli Zaretskii
2023-02-02  8:25                         ` Michael Albinus
2023-02-02  9:15                           ` Eli Zaretskii
2023-02-02 15:39                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-03 15:40                             ` Michael Albinus
2023-02-03 18:43                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-03 19:23                                 ` Michael Albinus
2023-02-03 20:51                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-04 16:04                                     ` Michael Albinus
2023-02-04 16:48                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-03 22:33                               ` Gregory Heytings
2023-02-04  9:54                                 ` Michael Albinus
2023-02-06 17:26                               ` Michael Albinus
2023-02-06 17:41                                 ` Gregory Heytings
2023-02-07  0:35                                 ` Michael Heerdegen
2023-02-07  8:54                                   ` Michael Albinus
2023-02-07 18:20                                     ` Michael Heerdegen
2023-02-07 18:30                                       ` Michael Albinus
2023-02-07 20:39                                         ` Michael Heerdegen
     [not found]                                           ` <87357h19qj.fsf@dick>
2023-02-08  8:05                                             ` Michael Albinus
2023-02-08 11:27                                               ` dick
2023-02-08 13:08                                                 ` Michael Albinus
2023-02-08 13:20                                                   ` Eli Zaretskii
2023-02-08 14:13                                                     ` dick
2023-02-08 14:42                                                       ` Michael Albinus
2023-02-08 13:30                                                   ` dick
2023-02-08 15:04                                           ` Michael Albinus
2023-02-07 22:22                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-08 15:11                                           ` Michael Albinus
2023-02-08 16:18                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-08 17:59                                               ` Michael Albinus
2023-02-08 19:03                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-10 16:55                                                   ` Michael Albinus
2023-02-12 19:26                                                     ` Michael Albinus
2023-02-07 19:18                                     ` Michael Heerdegen
2023-02-08 15:09                                       ` Michael Albinus
2023-02-09  0:38                                         ` Michael Heerdegen
2023-02-03  0:23                         ` Gregory Heytings [this message]
2023-02-03  7:43                           ` Juri Linkov
2023-02-03  8:39                             ` Michael Albinus
2023-02-03 12:01                             ` Eli Zaretskii
2023-02-02 15:16                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-02 15:05     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-05 20:58   ` Julien Roy
     [not found] <874k4xblcy.fsf.ref@aol.com>
2022-02-17 14:47 ` bug#54042: 29.0.50; fido-mode and ssh not listing hosts Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-17 16:43   ` Michael Albinus
     [not found]   ` <handler.54042.D60505.167623003032452.notifdone@debbugs.gnu.org>
2023-02-15 18:31     ` bug#54042: closed (Re: bug#60505: 29.0.60; Fido Mode and Tramp Completion) Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-16  8:51       ` Michael Albinus
2023-02-18 17:25         ` Michael Albinus
2023-02-19  2:04           ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19  9:53             ` 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=b0bd26d378bd8c1fe2f7@heytings.org \
    --to=gregory@heytings.org \
    --cc=60505@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=julien@jroy.ca \
    --cc=michael.albinus@gmx.de \
    --cc=monnier@iro.umontreal.ca \
    /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).