diff options
| author | Lars Ingebrigtsen | 2019-07-15 11:52:42 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-15 11:52:42 +0200 |
| commit | 4529057c97322893fb415512a2a51bc4616754f7 (patch) | |
| tree | 104c09b9cb03bfe49eb7b9fd0b2bad01ba77bfa9 /doc | |
| parent | dbd1d2ebf868964fa5b2db5440ba27560846f95f (diff) | |
| download | emacs-4529057c97322893fb415512a2a51bc4616754f7.tar.gz emacs-4529057c97322893fb415512a2a51bc4616754f7.zip | |
Make directory-files-recursively take a PREDICATE parameter
* lisp/files.el (directory-files-recursively): Take an optional
PREDICATE parameter (bug#28567).
* doc/lispref/files.texi (Contents of Directories): Document it.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/files.texi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 66678d33915..0519f787dce 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -2911,7 +2911,7 @@ An error is signaled if @var{directory} is not the name of a directory | |||
| 2911 | that can be read. | 2911 | that can be read. |
| 2912 | @end defun | 2912 | @end defun |
| 2913 | 2913 | ||
| 2914 | @defun directory-files-recursively directory regexp &optional include-directories | 2914 | @defun directory-files-recursively directory regexp &optional include-directories predicate |
| 2915 | Return all files under @var{directory} whose names match @var{regexp}. | 2915 | Return all files under @var{directory} whose names match @var{regexp}. |
| 2916 | This function searches the specified @var{directory} and its | 2916 | This function searches the specified @var{directory} and its |
| 2917 | sub-directories, recursively, for files whose basenames (i.e., without | 2917 | sub-directories, recursively, for files whose basenames (i.e., without |
| @@ -2925,6 +2925,13 @@ alphabetically by their basenames. By default, directories whose | |||
| 2925 | names match @var{regexp} are omitted from the list, but if the | 2925 | names match @var{regexp} are omitted from the list, but if the |
| 2926 | optional argument @var{include-directories} is non-@code{nil}, they | 2926 | optional argument @var{include-directories} is non-@code{nil}, they |
| 2927 | are included. | 2927 | are included. |
| 2928 | |||
| 2929 | By default, all subdirectories are descended into. If @var{predicate} | ||
| 2930 | is @code{t}, errors when trying to descend into a subdirectory (for | ||
| 2931 | instance, if it's not readable by this user) are ignored. If it's | ||
| 2932 | neither @code{nil} nor @code{t}, it should be a function that takes | ||
| 2933 | one parameter (the subdirectory name) and should return non-@code{nil} | ||
| 2934 | if the directory is to be descended into. | ||
| 2928 | @end defun | 2935 | @end defun |
| 2929 | 2936 | ||
| 2930 | @defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format | 2937 | @defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format |