GNU bug report logs -
#10085
24.0.91; completion-pcm--find-all-completions returns wrong remote file names
Previous Next
Reported by: Michael Albinus <michael.albinus <at> gmx.de>
Date: Sun, 20 Nov 2011 16:00:01 UTC
Severity: normal
Found in version 24.0.91
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>> `expand-file-name' seems to access the remote host. This can be
>>> suppressed by let-binding of `non-essential' to t.
>> I think adding non-essential to rfn-eshadow.el would be even more
>> correct (but it doesn't fix the underlying problem).
> Shall I submit such a patch towards rfn-eshadow.el, for the sake of the
> upcoming release?
You can even install it now.
> Honestly, I do not understand in detail the "underlying problem".
Simple completion tables have (all-completions STRING TABLE) return
a list whose elements all have STRING as a prefix.
More complex completion tables such as file-name completion instead
return a list whose elements have only a suffix of STRING as a prefix.
Until Emacs-23, completion tables could do this without telling anyone,
which restricted the kind of completion styles that could be implemented
(e.g. partial-completion-mode provided partial-completion for files in
an ad-hoc way, whereas Emacs-23 provides partial-completion for files
without using file-specific knowledge).
Emacs-23 solved this issue by adding a new method to completion tables,
called completion-boundaries which lets the completion table announce
which part of STRING will be the prefix of the all-completions result.
So, completion of "/foo/bar" is divided into fields "foo" and "bar" with
"/" as separators, and (completion-boundaries "/foo/bar") returns 5 to
indicate that "/foo/" will be stripped from all-completions's output,
leaving only "bar" as a prefix of all returned elements.
As I have shown with the trace, Tramp treats "/sud:" and "/sudo:"
differently, making the ":" a boundary separator in the first case but
not in the second. It's not strictly incorrect, but it is inconsistent
and makes it harder for the minibuffer.el code to behave well.
> I guess we need to find out, what are separators in Tramp wrt
> completion tables, and how to handle them.
The user finds out, the implementer decides.
Stefan
This bug report was last modified 9 years and 22 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.