[gnu.emacs.bug] File name completion problem -- A reply and a suggestion

ram-ashwin@YALE.ARPA (Ashwin Ram) (10/12/88)

> From: ucdavis.ucdavis.edu!austin@ucdavis.ucdavis.edu  (Darren Austin)
>                                    When doing filename completion
> it would be really nice if I could filter out what is considered
> a completion.
> tried the following from my *scratch* buffer:
> 
> 	(setq completion-ignored-extensions '(".elc .o"))
> 
> But it still showed *.elc files in the completion.  Am I doing
> something wrong here?

Yes.  You want to setq it to '(".elc" ".o"), i.e., a list of individual
strings, each of which specifies an extension, not a list of one string of
all the extensions.

This reminds me of a completion wish I've had for a while.  It would be nice
if one could type in a specification for a file name (or whatever one was
completing for) before hitting space, and have all the completions that match
that specification show up in the *Completions* buffer.  Examples:

        Find file: ~/foo/*.pas<SPACE>
        would complete to every .pas file in ~/foo.

        Describe variable: *file*<SPACE>
        would complete to every variable with the word "file" in it

Etc.  In other words, instead of a completion always being one with the given
string as a prefix, a completion would take a regexp (or some simpler
specification, I don't know) and a table, and return all the completions in
that table that matched that specification.  The current behavior would be a
special case of this.

Maybe it's just me, but I often wish for something like this.  I would use
this feature a lot if I had it, since I often know the form of the kind of
completion I'm looking for but not always its prefix (or the unique prefix
may be too long, etc.)

Just a suggestion...

-- Ashwin.