all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: dynamic completion-ignored-extensions
Date: Sun, 20 Jul 2008 08:53:27 -0600	[thread overview]
Message-ID: <g5vjh7$pqt$1@ger.gmane.org> (raw)
In-Reply-To: <873am8m2tu.fsf@blah.blah>

Kevin Ryde wrote:
> Is there a way to have a kind of dynamic completion-ignored-extensions
> so that for instance a .c file is ignored if there's a .xs of the same
> name?  Or even a kind of programmatic ignore so Makefile is not offered
> if it seems to be in a build directory of some flavour (and therefore a
> generated file).
> 
> I tried sticking a defadvice on file-name-completion, but in emacs22 it
> doesn't seem to be reached.  I guess read-file-name is C code and
> bypasses advice, or something.  Is there another filename reader that
> could be could be easily pressed into service and customized?

Right, and read-file-name is implemented in C as well, which is why
there is the read-file-name-function variable (C-h v).  Maybe something
like this will do what you want:

(defun my-read-file-name (&rest args)
   "Tweak `completion-ignored-extensions' before calling `read-file-name'."
   (let ((read-file-name-function nil)
	(completion-ignored-extensions (your-code-here)))
     (apply 'read-file-name args)))

(setq read-file-name-function 'my-read-file-name)

-- 
Kevin Rodgers
Denver, Colorado, USA





  reply	other threads:[~2008-07-20 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18  0:51 dynamic completion-ignored-extensions Kevin Ryde
2008-07-20 14:53 ` Kevin Rodgers [this message]
2008-07-24  0:43   ` Kevin Ryde

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='g5vjh7$pqt$1@ger.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.