emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 5fffed6: Document locate-dominating-file


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 5fffed6: Document locate-dominating-file
Date: Sat, 12 Oct 2019 18:22:43 -0400 (EDT)

branch: master
commit 5fffed6e88644cdf0a1d9fdaf728e75336e39ecd
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Document locate-dominating-file
    
    * doc/lispref/files.texi (Contents of Directories): Document
    locate-dominating-file (bug#33869).
---
 doc/lispref/files.texi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 3746c6d..130282c 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2924,6 +2924,7 @@ that can be read.
 @end defun
 
 @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
@@ -2949,6 +2950,19 @@ 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.
+@end defun
+
 @defun directory-files-and-attributes directory &optional full-name 
match-regexp nosort id-format
 This is similar to @code{directory-files} in deciding which files
 to report on and how to report their names.  However, instead



reply via email to

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