aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii2022-10-08 14:13:50 +0300
committerEli Zaretskii2022-10-08 14:13:50 +0300
commit32ef7550edc887f1f8e052cb57a61c4e82b6eecd (patch)
treefe0b4feaf77b1ad852ac02f9003c4ef1a175e796 /lisp
parentcfb1e218447c796f7a48347f648152b30f3edf92 (diff)
downloademacs-32ef7550edc887f1f8e052cb57a61c4e82b6eecd.tar.gz
emacs-32ef7550edc887f1f8e052cb57a61c4e82b6eecd.zip
; Improve documentation of 'file-in-directory-p'
* lisp/files.el (file-in-directory-p): Clarify doc string. * doc/lispref/files.texi (Truenames): Move the documentation of 'file-in-directory-p' from here... (Contents of Directories): ...to here. Add index entries. (Bug#58364)
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 860b9ca7249..e07f4796258 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6166,9 +6166,10 @@ If FILE1 or FILE2 does not exist, the return value is unspecified."
6166 (equal f1-attr f2-attr)))))) 6166 (equal f1-attr f2-attr))))))
6167 6167
6168(defun file-in-directory-p (file dir) 6168(defun file-in-directory-p (file dir)
6169 "Return non-nil if FILE is in DIR or a subdirectory of DIR. 6169 "Return non-nil if DIR is a parent directory of FILE.
6170A directory is considered to be \"in\" itself. 6170Value is non-nil if FILE is inside DIR or inside a subdirectory of DIR.
6171Return nil if DIR is not an existing directory." 6171A directory is considered to be a \"parent\" of itself.
6172DIR must be an existing directory, otherwise the function returns nil."
6172 (let ((handler (or (find-file-name-handler file 'file-in-directory-p) 6173 (let ((handler (or (find-file-name-handler file 'file-in-directory-p)
6173 (find-file-name-handler dir 'file-in-directory-p)))) 6174 (find-file-name-handler dir 'file-in-directory-p))))
6174 (if handler 6175 (if handler