bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#10085: 24.0.91; completion-pcm--find-all-completions returns wrong r


From: Michael Albinus
Subject: bug#10085: 24.0.91; completion-pcm--find-all-completions returns wrong remote file names
Date: Tue, 22 Nov 2011 22:55:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> Start "emacs -Q". Apply "C-x C-f /sudo:: TAB". This results in
>> "/sudo:sudo:root@". A correct expansion would be "/sudo:root@".
>
>> As far as I can see, Tramp's completion functions work properly.
>> The problem seems to be `completion-pcm--find-all-completions'.

> I think the patch below fixes it.

Yes, it does.

> The problem is that PCM assumes that
> a field separator cannot appear within a field.  In "/sudo::" the first
> / is a field separator, and the last ":" is also a field separator, but
> the first ":" isn't.

Unfortunately, I don't know anything about the completion machinery in
minibuffer.el. Maybe I should learn about. Is there documentation which
explains the concept of completion-table?

And is there something Tramp could do? It shall know the boundaries, and
it could provide such information more precisely.

> If you do "C-x C-f /sudo ?" you get "/sudo:" but if you
> do "C-x C-f /sudo: ?" you get "sudo:root@".  So fundamentally, the : of
> "/sudo:" acts a field separator, so (completion-boundaries "/sudo:") should
> probably return (6 . 0) rather than (1 . 0), and then "C-x C-f /sudo: ?"
> should list '("root@" ":") rather than '("sudo:root@").
>
> Related inconsistency from a trace of C-x C-f /sud: TAB:
>    1 -> completion-file-name-table: string="/sud:" pred=file-exists-p 
> action=(boundaries . "")
>    1 <- completion-file-name-table: (boundaries 5)
>    [...]
>    ======================================================================
>    1 -> completion-file-name-table: string="/sudo:" pred=file-exists-p 
> action=(boundaries . "")
>    1 <- completion-file-name-table: (boundaries 1)

I'ld like to check it if I could understand what's behind.

>         Stefan

Best regards, Michael.





reply via email to

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