[gnu.emacs] File name completion problem

austin@iris.ucdavis.edu (Darren Austin) (10/10/88)

Hi there,
	I am having a problem doing something in GNU Emacs 18.52
that I think should be very easy.  When doing filename completion
it would be really nice if I could filter out what is considered
a completion.  It would be really nice if I didn't have to see
*.o, and *.elc files (files which I would never want to edit
directly) in the completion.  I found the variable
"completion-ignored-extensions" which is supposed to be a list of
string endings that I do not want to see in my completions.  I
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?

Also, it would be real nice to be able to ignore dot files and
directories as well.  Is there an easy way to do this?  If not, I
am willing to write the elisp code necessary to filter the
completions, but I would rather not re-invent the wheel.

Thanks for your time,
--Darren
--
______________________________________________________________________

Darren Austin                         | "Memo to myself:
UC Davis Division of Computer Science |    Do the dumb things I gotta do;
austin@clover.ucdavis.edu	      |    Touch the puppet head"
				      |        --They Might Be Giants
______________________________________________________________________

austin@iris.ucdavis.edu (Darren Austin) (10/10/88)

Ooops!  in my last message, there was a typo.  I do realize that
it should "completion-ignored-extensions" needs to be a list of
strings, not a list of just one string.  but this still doesn't
work for me:
	
	(setq completion-ignored-extensions '(".elc" ".o"))

but it still doesn't filter out *.elc or *.o files.  Any ideas?
--Darren
--
______________________________________________________________________

Darren Austin                         | "Memo to myself:
UC Davis Division of Computer Science |    Do the dumb things I gotta do;
austin@clover.ucdavis.edu	      |    Touch the puppet head"
				      |        --They Might Be Giants
______________________________________________________________________

ljz%fxgrp.fx.com@ames.arc.nasa.gov (Lloyd Zusman) (10/12/88)

In article <AUSTIN.88Oct10010837@iris.ucdavis.edu> austin@iris.ucdavis.edu (Darren Austin) writes:

> ... When doing filename completion
>it would be really nice if I could filter out what is considered
>a completion.  ...
>
>	(setq completion-ignored-extensions '(".elc .o"))
>
>But it still showed *.elc files in the completion.  Am I doing
>something wrong here?

This should not be a list consisting of a single string, but rather,
a list of strings:

	(setq completion-ignored-extensions '(".elc" ".o"))

This is how it is defined in loaddefs.el.

>Also, it would be real nice to be able to ignore dot files and
>directories as well.  Is there an easy way to do this?  ...

I'd like to know how to do this, too.

--
  Lloyd Zusman                  Internet:  ljz@fx.com
  Master Byte Software                  or ljz%fx.com@ames.arc.nasa.gov
  Los Gatos, California                 or fxgrp!ljz@ames.arc.nasa.gov
  "We take things well in hand."    uucp:  ...!ames!fxgrp!ljz
  [ our Internet connection is down: use uucp or mail to the entry above it ]

wolfgang@mgm.mit.edu (Wolfgang Rupprecht) (10/12/88)

In article <AUSTIN.88Oct10010837@iris.ucdavis.edu> austin@iris.ucdavis.edu (Darren Austin) writes:
>	I am having a problem doing something in GNU Emacs 18.52
>[...]    It would be really nice if I didn't have to see
>*.o, and *.elc files.
>I 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. Try (setq completion-ignored-extensions '(".elc" ".o"))

In fact, there is something seriously botched with your copy of GNU
emacs if the completion-ingnored-extensions don't already include the
following:

'(".o" ".elc" "~" ".bin" ".lbin" ".fasl" ".dvi" ".toc" ".log" ".aux"
  ".lof" ".blg" ".bbl" ".glo" ".idx" ".lot")

-wolfgang
---
Wolfgang Rupprecht	ARPA:  wolfgang@mgm.mit.edu (IP 18.82.0.114)
TEL: (617) 267-4365	UUCP:  mit-eddie!mgm.mit.edu!wolfgang

mesard@bbn.com (Wayne Mesard) (10/12/88)

From article <AUSTIN.88Oct10092531@iris.ucdavis.edu>, by austin@iris.ucdavis.edu (Darren Austin):
[...]
> 	(setq completion-ignored-extensions '(".elc" ".o"))
> 
> but it still doesn't filter out *.elc or *.o files.  Any ideas?
> --Darren

What behavior are you expecting?  Setting the variable as above will NOT
prevent the ignored files from showing up in a *Completions* list (via
the '?' key == minibuffer-completion-help).  What it WILL do is
eliminate them as candidates for file name completion (via the TAB key
== minibuffer-complete).

-- 
void *Wayne_Mesard();         MESARD@BBN.COM         BBN, Cambridge, MA

"Look at the damn foliage!"

akhanna@bbn.com (Atul Khanna) (10/12/88)

In article <30728@bbn.COM> mesard@bbn.com (Wayne Mesard) writes:
>What behavior are you expecting?  Setting the variable as above will NOT
>prevent the ignored files from showing up in a *Completions* list (via
>the '?' key == minibuffer-completion-help).  What it WILL do is
>eliminate them as candidates for file name completion (via the TAB key
>== minibuffer-complete).
>

In fact, emacs will complete on files with extensions appearing in
completion-ignored-extensions if they are the only possible completions.
--------------------------------------------------------------------------
Atul C Khanna (akhanna@bbn.com)
BBN Communications Corporation
150 CambridgePark Drive
Cambridge, MA 02140

UUCP: ..!{decvax, wjh12, harvard}!bbnccv!akhanna