unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Leo <sdl.web@gmail.com>
Subject: Re: Ignore patterns for find-file tab completion?
Date: Sun, 29 Oct 2006 18:04:06 +0000	[thread overview]
Message-ID: <m2vem3gfs9.fsf@sl392.st-edmunds.cam.ac.uk> (raw)
In-Reply-To: 20061029175833.GA8389@cspcag2.swan.ac.uk

On Sun, 29/10/06, Andy Gimblett wrote:

> Hi there,
>
> I've been using emacs for about five years now; I know my way around
> reasonably well, but haven't done any elisp programming other than
> very simple stuff in my .emacs (a couple of lines at most).  I've just
> joined this list in order to ask a question regarding tab completion
> when opening a file using find-file (ie just with C-x C-f).
>
> In short: is it possible to specify a pattern for files to be
> _ignored_ in this context?
>
> Motivation:
>
>   1. I program in Haskell (sometimes).
>
>   2. Haskell source files have the suffix .hs (eg foo.hs)
>
>   3. A by-product of their compilation are .hi files (eg foo.hi), in
>      the same directory.
>
>   4. .hi files are not something I would ever, ever, want to load into
>      emacs.
>
>   5. Thus, I'd like to ignore them when trying to open a file.
>
> At the moment, given a directory containing a mix of .hs and .hi
> files, find-file's tab completion will typically get as far as ".h"
> (eg "foo.h") but then it has a choice between foo.hs and foo.hi, so it
> stops and I have to explicitly enter the "s".  This is annoying
> because:
>
>   a) I never want the .hi file, so it's a pointless question which I
>      would hope could be avoided;
>
>   b) If I forget, and just hit return, it tries to open "foo.h", which
>      almost certainly doesn't exist, so I get an empty buffer which I
>      then have to close before reattemting the find-file.
>
> Surely this is a common thing to want to do?  Is this a solved
> problem?
>
> Thanks!
>
> -Andy

It seems ido well suits your needs. it is located in
'emacs/23.0.0/lisp/ido.el.gz' in my system.

-- 
Leo

  reply	other threads:[~2006-10-29 18:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-29 17:58 Ignore patterns for find-file tab completion? Andy Gimblett
2006-10-29 18:04 ` Leo [this message]
2006-10-29 18:38 ` Drew Adams
2006-10-29 19:44   ` Andy Gimblett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2vem3gfs9.fsf@sl392.st-edmunds.cam.ac.uk \
    --to=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).