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

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

Re: Directory name completion blocks when it shouldn't


From: Tim Van Holder
Subject: Re: Directory name completion blocks when it shouldn't
Date: Mon, 11 Dec 2006 08:52:02 +0100

On 12/5/06, Richard Stallman <address@hidden> wrote:
    With M-x cd, entering "/t" TAB completes to "/top-dir/" like it should,
    but "/top-dir/s" TAB does NOT complete to "/top-dir/sub-dir/" even though
    there is only 1 matching directory (TAB TAB shows only "sub-dir" as only
    alternative); it's necessary to disambiguate the directory name from the
    names of any and all files in the same location for tab completion to
    proceed.  This seems like a bug.

That is correct behavior, because subdirectory names are NOT the only
valid inputs.  Suppose the directory also contains img_0304.jpg,
img_0305.jpg, ... img_0315.jpg.  You might want to type `i TAB *.jpg'.

Because it seemed like people were misunderstanding my original
report, I looked a little deeper.
"M-x" cd runs read-directory-name already, so the whole "we shouldn't
use r-d-n" argument does not apply, nor does the argument above --
non-directories ARE the only valid inputs for r-d-n.  The actual issue is
that completion for r-d-n, despite using a file-directory-p predicate, does
not complete automatically if there's also a regular file with the same
initial name.
That IS a bug in my opinion, especially since the list of matches shown
by TAB TAB does filter the matches properly according to the predicate.

This seems to be by design however, since read-file-name-internal only
applies the predicate when returning the full list of completions; for
"normal" completion, file-name-completion is called and the predicate
remains completely unused.  Perhaps file-name-completion should
get a predicate argument as well; it could default to one that ignored
certain extensions (as the function does now).  Then r-d-n could just
pass its predicate along.




reply via email to

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