help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: Ignore patterns for find-file tab completion?


From: Drew Adams
Subject: RE: Ignore patterns for find-file tab completion?
Date: Sun, 29 Oct 2006 10:38:27 -0800

    .hi files are not something I would ever, ever, want to load into
    emacs. Thus, I'd like to ignore them when trying to open a file.

    Surely this is a common thing to want to do?  Is this a solved
    problem?

Yes, it is a common thing to do. You can customize option
`completion-ignored-extensions' so that files with a given extension (e.g.
hi) are ignored for completion. That should do exactly what you want.

FYI - If you use Icicles (http://www.emacswiki.org/cgi-bin/wiki/Icicles),
you can, in addition, exclude completion candidates in a few additional
ways.

1. You can use `C-~' on the fly to complement the current set of completion
candidates (file names, buffer names, etc.). For example, type `C-x b foo'
and then `C-~' to match all buffers that do not start with `foo' (or do not
contain `foo', if you complete with `S-TAB').

2. You can exclude any number of different patterns by combining `C-~' with
`M-*', which lets you match against additional patterns. For example, to
exclude all completion candidates that match `toto', `titi', or `foobar',
you would type this:
  `toto C-~ M-* titi C-~ M-* foobar'

This is useful for apropos completion (`S-TAB'), where your input is matched
against any part of a candidate name (actually, your input is taken as a
regexp).

3. If you often want to exclude certain buffers as candidates, you can
create and save a buffer configuration that uses variable
`icicle-no-match-regexp' to exclude those buffers whenever that
configuration is used. See commands `icicle-add-buffer-config' and
`icicle-buffer-config'.






reply via email to

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