From 6b6b99547b477c24b5575116f1a42b82d045fb17 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 20 Jul 2007 04:00:37 +0000 Subject: [PATCH] (locate-dominating-file): Add comment. --- lisp/files.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/files.el b/lisp/files.el index 631e75f98d0..3a922e3d708 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -720,6 +720,10 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)." ;; Abbreviate, so as to stop when we cross ~/. (dir (abbreviate-file-name (file-name-as-directory file))) files) + ;; As a heuristic, we stop looking up the hierarchy of directories as + ;; soon as we find a directory belonging to another user. This should + ;; save us from looking in things like /net and /afs. This assumes + ;; that all the files inside a project belong to the same user. (while (and dir (equal user (nth 2 (file-attributes dir)))) (if (setq files (directory-files dir 'full regexp)) (throw 'found (car files)) -- 2.39.5