comparison lisp/files.el @ 90988:492971a3f31f unicode-xft-base

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 816-823) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 59-69) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 237-238) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-235
author Miles Bader <miles@gnu.org>
date Tue, 24 Jul 2007 01:23:55 +0000
parents a1be62cbd32a 7620cd626c41
children f55f9811f5d7
comparison
equal deleted inserted replaced
90987:b2d8a283f27e 90988:492971a3f31f
708 (push (if string-dir (concat string-dir file) file) names))))) 708 (push (if string-dir (concat string-dir file) file) names)))))
709 (cond 709 (cond
710 ((eq action t) (all-completions string names)) 710 ((eq action t) (all-completions string names))
711 ((null action) (try-completion string names)) 711 ((null action) (try-completion string names))
712 (t (test-completion string names)))))) 712 (t (test-completion string names))))))
713
714 (defun locate-dominating-file (file regexp)
715 "Look up the directory hierarchy from FILE for a file matching REGEXP."
716 (while (and file (not (file-directory-p file)))
717 (setq file (file-name-directory (directory-file-name file))))
718 (catch 'found
719 (let ((user (nth 2 (file-attributes file)))
720 ;; Abbreviate, so as to stop when we cross ~/.
721 (dir (abbreviate-file-name (file-name-as-directory file)))
722 files)
723 ;; As a heuristic, we stop looking up the hierarchy of directories as
724 ;; soon as we find a directory belonging to another user. This should
725 ;; save us from looking in things like /net and /afs. This assumes
726 ;; that all the files inside a project belong to the same user.
727 (while (and dir (equal user (nth 2 (file-attributes dir))))
728 (if (setq files (directory-files dir 'full regexp))
729 (throw 'found (car files))
730 (if (equal dir
731 (setq dir (file-name-directory
732 (directory-file-name dir))))
733 (setq dir nil))))
734 nil)))
713 735
714 (defun executable-find (command) 736 (defun executable-find (command)
715 "Search for COMMAND in `exec-path' and return the absolute file name. 737 "Search for COMMAND in `exec-path' and return the absolute file name.
716 Return nil if COMMAND is not found anywhere in `exec-path'." 738 Return nil if COMMAND is not found anywhere in `exec-path'."
717 ;; Use 1 rather than file-executable-p to better match the behavior of 739 ;; Use 1 rather than file-executable-p to better match the behavior of
2462 mode-line-modes 2484 mode-line-modes
2463 mode-line-modified 2485 mode-line-modified
2464 mode-line-mule-info 2486 mode-line-mule-info
2465 mode-line-position 2487 mode-line-position
2466 mode-line-process 2488 mode-line-process
2489 mode-line-remote
2467 mode-name 2490 mode-name
2468 outline-level 2491 outline-level
2469 overriding-local-map 2492 overriding-local-map
2470 overriding-terminal-local-map 2493 overriding-terminal-local-map
2471 parse-time-rules 2494 parse-time-rules