summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-10-09 06:31:06 +0200
committerStefan Kangas <stefankangas@gmail.com>2022-10-09 06:31:06 +0200
commita2dd9d683a02525183b5e692e42622c65639dda8 (patch)
treee9d91a430f3c0b39ec48b6791bfad09132b4a90d /lisp/files.el
parent9d47364634f96b2f2651a7f3942f8f87b920f02d (diff)
parent32ef7550edc887f1f8e052cb57a61c4e82b6eecd (diff)
downloademacs-a2dd9d683a02525183b5e692e42622c65639dda8.tar.gz
emacs-a2dd9d683a02525183b5e692e42622c65639dda8.tar.bz2
emacs-a2dd9d683a02525183b5e692e42622c65639dda8.zip
Merge from origin/emacs-28
32ef7550ed ; Improve documentation of 'file-in-directory-p'
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 43c5d7d1da1..94d110f0b7d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6344,9 +6344,10 @@ If FILE1 or FILE2 does not exist, the return value is unspecified."
(equal f1-attr f2-attr))))))
(defun file-in-directory-p (file dir)
- "Return non-nil if FILE is in DIR or a subdirectory of DIR.
-A directory is considered to be \"in\" itself.
-Return nil if DIR is not an existing directory."
+ "Return non-nil if DIR is a parent directory of FILE.
+Value is non-nil if FILE is inside DIR or inside a subdirectory of DIR.
+A directory is considered to be a \"parent\" of itself.
+DIR must be an existing directory, otherwise the function returns nil."
(let ((handler (or (find-file-name-handler file 'file-in-directory-p)
(find-file-name-handler dir 'file-in-directory-p))))
(if handler