Extend file-expand-wildcards to allow regexps

* doc/lispref/files.texi (Contents of Directories): Document it.
* lisp/files.el (file-expand-wildcards): Extend to allow regexps.

* lisp/emacs-lisp/shortdoc.el (file): Expand the
file-expand-wildcards example.
This commit is contained in:
Lars Ingebrigtsen 2022-06-05 14:08:31 +02:00
parent 6011d39b6a
commit d8924e179e
4 changed files with 30 additions and 8 deletions

View file

@ -468,7 +468,9 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
:no-eval* (directory-files-and-attributes "/tmp/foo"))
(file-expand-wildcards
:no-eval (file-expand-wildcards "/tmp/*.png")
:eg-result ("/tmp/foo.png" "/tmp/zot.png"))
:eg-result ("/tmp/foo.png" "/tmp/zot.png")
:no-eval (file-expand-wildcards "/*/foo.png")
:eg-result ("/tmp/foo.png" "/var/foo.png"))
(locate-dominating-file
:no-eval (locate-dominating-file "foo.png" "/tmp/foo/bar/zot")
:eg-result "/tmp/foo.png")