emacs-devel
[Top][All Lists]
Advanced

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

RE: Q on read-file-name and completion-ignored-extensions


From: Drew Adams
Subject: RE: Q on read-file-name and completion-ignored-extensions
Date: Thu, 19 Jan 2006 17:50:05 -0800

    What about the alternative docstring in the patch below?  That one
    should describe the actual behavior or there _is_ a bug (on Windows).
    I can install if desired.

    To explain what _should_ happen and _does_ happen on GNU/Linux: I have
    four files starting with cin: cinv.tex, cinv.tex~, cinv.aux and
    cinv.dvi.

    All but one end in a string in completion-ignored-extensions.  If I do
    `C-x C-f cin TAB', it completes to cinv.tex, ignoring the three other
    ones.  But if I do `C-x C-f cin ?', I get a list of all four.  This
    feature is meant to allow you to complete to what you _probably_ want
    with less typing.  It is _not_ meant to prevent you from visiting
    files that end in one of these suffixes.

    !          Completion ignores file names ending in any
    string in this list.
    ! It does not ignore them if all possible completions end in one of
    ! these strings or when displaying a list of completions.
    ! It ignores directory names if they match any string in this list which
    ! ends in a slash.

Thanks very much. This clears up a lot.

I guess the reference to `file-name-all-completions' was mistaken, and
"affects lists of possible completions" in the original doc string meant
only (?) what you write above: _displaying_ a list of completions (in buffer
*Completions*).

What's more, the part about "if all possible completions end in one of these
strings" is new to me, and it clears up my misunderstanding wrt why it was
completing filenames that have the ignored extensions. There is apparently
no bug on Windows - I was just missing this bit of info (if all possible
completions have ignored extensions, then no ignoring is done).

We should perhaps clarify this case: C-x C-f cinv. TAB

This does _not_ display the list (of all four files), even though TAB would
normally display the list of possible completions in that case (since the
common part is already in the minibuffer). Instead, it completes to
cinv.tex. This case should somehow be documented - I don't think it's
implied by the rules expressed in your doc string.

Is it perhaps true that the "displaying a list of completions" that shows
ignored completions (even when there are non-ignored candidates) applies
only to display by `?' and not to display by TAB? If so, that would make the
explanation even simpler: just say that `?' is unaffected by this variable.
Whatever the real rule is, we should make it clear.

IMO, it wouldn't hurt to add short examples of the various cases to either
the doc string or the manual: 1) if all possible completions have ignored
extensions, they are not ignored, 2) otherwise, completions with ignored
extensions are still displayed in *Completions*, so you can compare them
with filenames that you can complete to, ...

Thanks, Luc. I don't know if what you wrote was obvious from the beginning
to others, but it was certainly not obvious to me.





reply via email to

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