[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 0fcd6e3: ; Fix recent additions to ELisp manual
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] master 0fcd6e3: ; Fix recent additions to ELisp manual |
Date: |
Sun, 13 Oct 2019 03:52:03 -0400 (EDT) |
branch: master
commit 0fcd6e320dbb7ee7614d432b7d6b5fca5b8960bc
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
; Fix recent additions to ELisp manual
* doc/lispref/files.texi (Contents of Directories): Fix
recently added documentation of 'locate-dominating-file'.
---
doc/lispref/files.texi | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 130282c..32297e9 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2923,8 +2923,8 @@ An error is signaled if @var{directory} is not the name
of a directory
that can be read.
@end defun
+@cindex recursive traverse of directory tree
@defun directory-files-recursively directory regexp &optional
include-directories predicate follow-symlinks
-@cindex recursing downwards in directories
Return all files under @var{directory} whose names match @var{regexp}.
This function searches the specified @var{directory} and its
sub-directories, recursively, for files whose basenames (i.e., without
@@ -2950,17 +2950,23 @@ Symbolic links to subdirectories are not followed by
default, but if
@var{follow-symlinks} is non-@code{nil}, they are followed.
@end defun
+
@defun locate-dominating-file file name
-@cindex recursing upwards in directories
-Starting at @var{file}, recurse up the directory hierarchy looking for
-the first directory where @var{name} exists, which is then the return
-value of this function. @var{file} can be a file or a directory. If
-it's a file, its directory will serve as the starting point for
-searching the hierarchy of directories.
-
-@code{name} can be either a string or a predicate. The predicate
-takes one argument (the directory) and should return non-@code{nil} if
-we've found the directory we're looking for.
+Starting at @var{file}, go up the directory tree hierarchy looking for
+the first directory where @var{name}, a string, exists, and return that
+directory. If @var{file} is a file, its directory will serve as the
+starting point for the search; otherwise @var{file} should be a
+directory from which to start. The function looks in the starting
+directory, then in its parent, then in its parent's parent, etc.,
+until it either finds a directory with @var{name} or reaches the root
+directory of the filesystem without finding @var{name} -- in the
+latter case the function returns @code{nil}.
+
+The argument @code{name} can also be a predicate function. The
+predicate is called for every directory examined by the function,
+starting from @var{file} (even if @var{file} is not a directory). It
+is called with one argument (the file or directory) and should return
+non-@code{nil} if that directory is the one it is looking for.
@end defun
@defun directory-files-and-attributes directory &optional full-name
match-regexp nosort id-format
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 0fcd6e3: ; Fix recent additions to ELisp manual,
Eli Zaretskii <=