Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!rutgers!nysernic!itsgw!leah!uwmcsd1!ig!jade!ucbcad!zen!stinson!grady
From: grady@stinson.uucp (Steven Grady)
Newsgroups: comp.emacs
Subject: Re: find-file with wildcarding? | emacs lisp programmers' manual
Message-ID: <5238@zen.berkeley.edu>
Date: Sun, 6-Dec-87 23:21:01 EST
Article-I.D.: zen.5238
Posted: Sun Dec  6 23:21:01 1987
Date-Received: Sat, 12-Dec-87 06:08:23 EST
References: <151@csvaxa.UUCP>
Sender: news@zen.berkeley.edu
Reply-To: grady@postgres.berkeley.edu (Steven Grady)
Organization: Postgres Research Group, UC Berkeley
Lines: 25

In article <151@csvaxa.UUCP> edward@csvaxa.UUCP (Edward Wilkinson) writes:
>Has anyone  written  such a  function   which allows the   use of  csh
>wildcards?

Yeah, I wrote something like that a couple months ago - find-multiple-files.
My favorite use: (find-multiple-files "[ch]$").  Problem:  doesn't allow
files not in the current directory.

(defun find-multiple-files (file-regexp)
  "Find all files matching FILE-REGEXP.
Switches to first matching buffer in FILE-REGEXP after matching to
all files in the current directory."
  (interactive "sWhat files? ")
  (let ((files (directory-files "." nil file-regexp)))
    (if (null files) (error "No files"))
    (message "Retrieving %s" file-regexp)
    (let ((f files))
      (while f
	(find-file-noselect (car f))
	(setq f (cdr f)))
      (switch-to-buffer (car files)))))

	Steven
	grady@postgres.berkeley.edu
	...!ucbvax!grady