all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Denis Bueno" <dbueno@gmail.com>
To: emacs-devel@gnu.org
Subject: Looking for interactive `locate-file'
Date: Mon, 5 Mar 2007 20:53:13 -0500	[thread overview]
Message-ID: <6dbd4d000703051753j23014087ob8beb4edf1741458@mail.gmail.com> (raw)

Dear list-

I would like to be able to interactive find a file inside a list of
paths, interactively, and in a way that supports some basic pattern
matching. (For reference, the reason I want this is that Eclipse has
it, and I find it quite useful.) Currently, I have a first
approximation [1], but, it sucks. All it does is ask for a (possibly
non-existent) filename, then look for that in a default list of paths.

I want to set up a list of directories pertaining to a particular
project. Then when I M-x find-resource, I want it to ask for the
filename and look in those paths for it -- interactively, listing all
matches as I type. So if I were to type "type*.jsp", a results buffer
would list all the files matching that pattern.

Has anyone written something like what I'm looking for, before?

-Denis

[1]

;; make sure you put some directories in here:
(defvar *project-paths* '())

(defun find-resource (filename)
  "Find `filename' in *project-paths*, if it can be found in any
directory there. If not, returns nil."
  (interactive "FFilename: ")
  (let ((file (locate-file filename *project-paths*)))
    (if file (find-file file)
      (message (concat "`" filename "' not found.")))))

             reply	other threads:[~2007-03-06  1:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06  1:53 Denis Bueno [this message]
2007-03-06  2:37 ` Looking for interactive `locate-file' Stefan Monnier
2007-03-06  3:32   ` Denis Bueno
2007-03-06 14:32     ` Stefan Monnier
2007-03-06 11:37 ` Johan Bockgård
2007-03-06 14:29 ` Drew Adams
2007-03-06 16:23 ` Stuart D. Herring
     [not found] ` <mailman.522.1173191449.7795.help-gnu-emacs@gnu.org>
2007-03-06 18:38   ` weber

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=6dbd4d000703051753j23014087ob8beb4edf1741458@mail.gmail.com \
    --to=dbueno@gmail.com \
    --cc=emacs-devel@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.