[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 37b88d7: Fix bug#23006

From: Stefan Monnier
Subject: Re: [Emacs-diffs] master 37b88d7: Fix bug#23006
Date: Fri, 10 Mar 2017 05:34:03 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> If you believe this is wrong, then Tramp needs another variable for such
> a trigger.  As we did agree originally in
> <http://lists.gnu.org/archive/html/bug-gnu-emacs/2010-04/msg00371.html>.
> The idea to take `non-essential' instead came later from you.

IIUC the problem comes from the following:

1- in the process of performing completion, the completion code will end
   up using "subparts" of a filename.  More specifically, the user may
   write something like "/ssh:foo:bar" but the completion code somehow
   ends up invoking file functions (and hence Tramp) on "/ssh:foo".

2- For historical reasons, Tramp wants to allow users to write
   "/ssh:foo" to access files on the "ssh" host.

So in order for Tramp to figure out where the "/ssh:foo" that it
received should be treated as "foo on ssh" or as "incomplete host foo
via ssh", you need to try and figure out where we're in case 1 or case
2, and you try to do that using some heuristic, part of which is to look
at `non-essential'.

Sadly, `non-essential' is not there for that purpose, so it is only
somewhat correlated with the info you want, but is not a reliable
indicator (neither sufficient nor necessary).

I see 2 ways out of this problem:
- Introduce a new variable which indicates we're performing completion.
  I'm not sure exactly what "performing completion" means precisely,
  but maybe binding it in completion-file-name-table would be sufficient
  for Tramp's needs.
- Get rid of this historical syntax.  We could still accept "/ssh:./foo"
  (or maybe even "/ssh:foo/bar", tho this one looks more risky) to
  access the "ssh" host, which seems like a very minor annoyance.

I'm strongly in favor of the second option: while the ambiguity of
"/ssh:foo" is only known to bite us in the case of completion, I'd be
surprised if there aren't other cases where it hurts.  Also the way
Tramp currently behaves subtly differently while completing than in
other contexts is a source of complexity of bugs which I'd rather
eliminate (I remember some problems linked to such discrepancies around


reply via email to

[Prev in Thread] Current Thread [Next in Thread]