On 12/5/06, Richard Stallman <[EMAIL PROTECTED]> 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.


_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to