[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/files.el,v
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/files.el,v |
Date: |
Thu, 19 Jul 2007 03:29:50 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 07/07/19 03:29:49
Index: files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.912
retrieving revision 1.913
diff -u -b -r1.912 -r1.913
--- files.el 17 Jul 2007 21:07:49 -0000 1.912
+++ files.el 19 Jul 2007 03:29:47 -0000 1.913
@@ -711,6 +711,24 @@
((null action) (try-completion string names))
(t (test-completion string names))))))
+(defun locate-dominating-file (file regexp)
+ "Look up the directory hierarchy from FILE for a file matching REGEXP."
+ (while (and file (not (file-directory-p file)))
+ (setq file (file-name-directory (directory-file-name file))))
+ (catch 'found
+ (let ((user (nth 2 (file-attributes file)))
+ ;; Abbreviate, so as to stop when we cross ~/.
+ (dir (abbreviate-file-name (file-name-as-directory file)))
+ files)
+ (while (and dir (equal user (nth 2 (file-attributes dir))))
+ (if (setq files (directory-files dir 'full regexp))
+ (throw 'found (car files))
+ (if (equal dir
+ (setq dir (file-name-directory
+ (directory-file-name dir))))
+ (setq dir nil))))
+ nil)))
+
(defun executable-find (command)
"Search for COMMAND in `exec-path' and return the absolute file name.
Return nil if COMMAND is not found anywhere in `exec-path'."
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Richard M. Stallman, 2007/07/02
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Richard M. Stallman, 2007/07/02
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Stefan Monnier, 2007/07/07
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Michael Albinus, 2007/07/08
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Miles Bader, 2007/07/09
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Michael Albinus, 2007/07/17
- [Emacs-diffs] Changes to emacs/lisp/files.el,v,
Stefan Monnier <=
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Stefan Monnier, 2007/07/20
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Nick Roberts, 2007/07/22
- [Emacs-diffs] Changes to emacs/lisp/files.el,v, Miles Bader, 2007/07/26