all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Gimblett <A.M.Gimblett@swansea.ac.uk>
Subject: Ignore patterns for find-file tab completion?
Date: Sun, 29 Oct 2006 17:58:33 +0000	[thread overview]
Message-ID: <20061029175833.GA8389@cspcag2.swan.ac.uk> (raw)

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

-- 
Andy Gimblett
Computer Science Department
University of Wales Swansea
http://www.cs.swan.ac.uk/~csandy/

             reply	other threads:[~2006-10-29 17:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-29 17:58 Andy Gimblett [this message]
2006-10-29 18:04 ` Ignore patterns for find-file tab completion? Leo
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

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

  git send-email \
    --in-reply-to=20061029175833.GA8389@cspcag2.swan.ac.uk \
    --to=a.m.gimblett@swansea.ac.uk \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.