On 3 Jun 2000, Stefan Monnier
<[EMAIL PROTECTED]> wrote:

>>>>>> "Joe" == Joe Stoy <[EMAIL PROTECTED]> writes:

[...]

>> 2. Is there another problem with filename completion too? If I do it
>> completely locally, for example with "tramp.", I can if I press TAB
>> often enough, get it to offer me "tramp.el", "tramp.el~" and
>> "tramp.elc". Doing it remotely, it tries to tell me that "tramp.el"
>> is the "[sole completion]" (even though the other ones are there). It
>> seems that the "hidden extensions" keep themselves too hidden.
> 
> I think filtering completion-ignored-extensions is a mistake indeed.
> It should be (and most likely is) done in the function that call
> file-name-all-completions.

[...]

> Using shell-globbing is a problem since it can fail in really long
> directories.  I know that recent Unixen have a max-arg-length
> much higher than what it used to be, but I'd rather not rely on it.
> Also passing filename unquoted will not do the right thing.
> How about
> 
>         (format "%s -a 2>/dev/null | fgrep %s"
>                 (tramp-get-ls-command multi-method method user host)
>                 (tramp-shell-quote-argument filename))
> 
> It will match more than what we need (since fgrep does a `substring
> match' rather than a `prefix match'), but the subsequent
> all-completions call will filter out the few false-positives. Sadly,
> the fgrep will fail if `filename' starts with a dash :-(

Hrm. Questions to those who do have access to non-Linux machines (and,
specifically, non-GNU f?grep), how do these two options work for you:

a) ls -a 2>/dev/null | f?grep ^%s
b) ls -a 2>/dev/null | f?grep -- %s

I think that option (a) should address both the 'substring' match issue
and the leading '-' issue. I think, also, that it should work right with
the 'grep' available anywhere, but maybe not with the 'fgrep' anywhere.

Unfortunately, I have only experience of the GNU .?grep utilities, so I
don't know for sure. If others could test and let me know, please?

Option (b) is less desirable - but if '--' serves as 'end of options' on
other greps, it would serve to address the leading '-' issue.

>>       ;; Now get a list of directories in a similar way.

The rest of it looks relatively sane, I think. If I can get comments on
the syntax acceptable for the grep, I can probably have a look at
changing this today...

        Daniel

-- 
Make me walk / Make me talk / Do whatever you please
I can act like a star / I can beg on my knees
        -- Aqua, _Barbie Girl_

Reply via email to