diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-06-05 14:08:31 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-06-05 14:08:31 +0200 |
commit | d8924e179e2e53bf9abffa987f428890b4edcf57 (patch) | |
tree | a4317056abf76174197702532980f8aa2cc87148 /doc/lispref/files.texi | |
parent | 6011d39b6a4bc659da364255bcae22c4e6ef3a3f (diff) | |
download | emacs-d8924e179e2e53bf9abffa987f428890b4edcf57.tar.gz emacs-d8924e179e2e53bf9abffa987f428890b4edcf57.tar.bz2 emacs-d8924e179e2e53bf9abffa987f428890b4edcf57.zip |
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.
Diffstat (limited to 'doc/lispref/files.texi')
-rw-r--r-- | doc/lispref/files.texi | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 75905658e64..d4732610262 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -3112,10 +3112,16 @@ except those two. It is useful as the @var{match-regexp} argument to returns @code{nil}, if directory @samp{/foo} is empty. @end defvr -@defun file-expand-wildcards pattern &optional full +@defun file-expand-wildcards pattern &optional full regexp This function expands the wildcard pattern @var{pattern}, returning a list of file names that match it. +@var{pattern} is, by default, a ``glob''/wildcard string, e.g., +@samp{"/tmp/*.png"} or @samp{"/*/*/foo.png"}, but can also be a +regular expression if the optional @var{regexp} parameter is non-nil. +In any case, the matches are applied per sub-directory, so a match +can't span a parent/sub directory. + If @var{pattern} is written as an absolute file name, the values are absolute also. |