emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Globbing file name match function?


From: Eli Zaretskii
Subject: Re: Globbing file name match function?
Date: Sun, 05 Jun 2022 14:23:10 +0300

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]