unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: Globbing file name match function?
Date: Sun, 05 Jun 2022 14:23:10 +0300	[thread overview]
Message-ID: <83k09v9wwx.fsf@gnu.org> (raw)
In-Reply-To: <87bkv75prr.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun,  05 Jun 2022 13:11:04 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sun, 05 Jun 2022 13:11:04 +0200
> 
> I've been poking around for a couple of minutes to see whether we have a
> function to list files matching a regexp a la how a shell matches them.
> That is:
> 
> $ ls ~/src/emacs/*/lisp/abbrev.el
> /home/larsi/src/emacs/27.1/lisp/abbrev.el
> /home/larsi/src/emacs/bisect/lisp/abbrev.el
> /home/larsi/src/emacs/emacs-28/lisp/abbrev.el
> /home/larsi/src/emacs/foo/lisp/abbrev.el
> ...
> 
> This is with a glob, but ideally you'd be able to drop in a regexp
> anywhere in the file name.  Do we have that anywhere in Emacs?

ls-lisp.el does.  It converts a wildcard to regexp, and then uses
directory-files with MATCH set to the regexp.

Do you mean specifically a wildcard in the middle of a file name,
which stands for matching subdirectories?



  reply	other threads:[~2022-06-05 11:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05 11:11 Globbing file name match function? Lars Ingebrigtsen
2022-06-05 11:23 ` Eli Zaretskii [this message]
2022-06-05 11:25   ` Lars Ingebrigtsen
2022-06-05 11:29     ` Eli Zaretskii
2022-06-05 11:59       ` Lars Ingebrigtsen
2022-06-05 13:29         ` Stefan Monnier
2022-06-05 20:34         ` Philip Kaludercic
2022-06-05 20:42           ` Lars Ingebrigtsen
2022-06-06  8:02             ` Andreas Schwab
2022-06-05 11:39 ` Andreas Schwab

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=83k09v9wwx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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 public inbox

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

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).