# HG changeset patch # User Stefan Monnier # Date 1184904037 0 # Node ID f41d4ecf6cb43f9766fcc830b9d88d02feba8798 # Parent cd7d70b6659e9d6128546ef3fa0a96fc7d33f275 (locate-dominating-file): Add comment. diff -r cd7d70b6659e -r f41d4ecf6cb4 lisp/files.el --- a/lisp/files.el Fri Jul 20 03:59:03 2007 +0000 +++ b/lisp/files.el Fri Jul 20 04:00:37 2007 +0000 @@ -720,6 +720,10 @@ ;; 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))