aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-05-22 03:09:34 +0000
committerStefan Monnier2008-05-22 03:09:34 +0000
commita77b655d874ebe7c40fe244d91e1e607e4fcfb25 (patch)
tree5bf81c8537cbd0dea06cd66265f3a60cf1c9f50b
parent4cd217dc0db45f2305d19e0ab7801d7aead73cd7 (diff)
downloademacs-a77b655d874ebe7c40fe244d91e1e607e4fcfb25.tar.gz
emacs-a77b655d874ebe7c40fe244d91e1e607e4fcfb25.zip
(locate-dominating-file): Accept non-existing argument.
(project-find-settings-file): Rewrite, using locate-dominating-file.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/files.el31
2 files changed, 25 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 00e503e2ad4..213cfd9b98a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,15 +1,18 @@
12008-05-22 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * files.el (locate-dominating-file): Accept non-existing argument.
4 (project-find-settings-file): Rewrite, using locate-dominating-file.
5
12008-05-22 Kenichi Handa <handa@m17n.org> 62008-05-22 Kenichi Handa <handa@m17n.org>
2 7
3 * faces.el (font-weight-table, font-slant-table) 8 * faces.el (font-weight-table, font-slant-table, font-width-table):
4 (font-width-table): Delete them. Don't call 9 Delete them. Don't call internal-set-font-style-table.
5 internal-set-font-style-table.
6 10
7 * international/mule-diag.el (font-show-log): New function. 11 * international/mule-diag.el (font-show-log): New function.
8 12
9 * international/fontset.el (script-representative-chars): Add more 13 * international/fontset.el (script-representative-chars): Add more
10 chars for latin. Add data for symbol. 14 chars for latin. Add data for symbol.
11 (setup-default-fontset): Add entries for phonetic, armenian, and 15 (setup-default-fontset): Add entries for phonetic, armenian, and symbol.
12 symbol.
13 16
142008-05-21 Stefan Monnier <monnier@iro.umontreal.ca> 172008-05-21 Stefan Monnier <monnier@iro.umontreal.ca>
15 18
diff --git a/lisp/files.el b/lisp/files.el
index 2a00f1edb35..9802f903eeb 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -746,7 +746,8 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)."
746 (let ((prev-user user)) 746 (let ((prev-user user))
747 (setq user (nth 2 (file-attributes file))) 747 (setq user (nth 2 (file-attributes file)))
748 (or (null prev-user) (equal user prev-user)))) 748 (or (null prev-user) (equal user prev-user))))
749 (if (setq files (directory-files dir 'full regexp)) 749 (if (setq files (and (file-directory-p dir)
750 (directory-files dir 'full regexp)))
750 (throw 'found (car files)) 751 (throw 'found (car files))
751 (if (equal dir 752 (if (equal dir
752 (setq dir (file-name-directory 753 (setq dir (file-name-directory
@@ -3119,19 +3120,21 @@ If a settings file is found, the file name is returned.
3119If the file is in a registered project, a cons from 3120If the file is in a registered project, a cons from
3120`project-directory-alist' is returned. 3121`project-directory-alist' is returned.
3121Otherwise this returns nil." 3122Otherwise this returns nil."
3122 (let ((dir (file-name-directory file)) 3123 (setq file (expand-file-name file))
3123 (result nil)) 3124 (let* ((settings (locate-dominating-file file "\\`\\.dir-settings\\.el\\'"))
3124 (while (and (not (string= dir "/")) 3125 (pda nil))
3125 (not result)) 3126 ;; `locate-dominating-file' may have abbreviated the name.
3126 (cond 3127 (if settings (setq settings (expand-file-name settings)))
3127 ((setq result (assoc dir project-directory-alist)) 3128 (dolist (x project-directory-alist)
3128 ;; Nothing else. 3129 (when (and (eq t (compare-strings file nil (length (car x))
3129 nil) 3130 (car x) nil nil))
3130 ((file-exists-p (expand-file-name ".dir-settings.el" dir)) 3131 (> (length (car x)) (length (car pda))))
3131 (setq result (expand-file-name ".dir-settings.el" dir))) 3132 (setq pda x)))
3132 (t 3133 (if (and settings pda)
3133 (setq dir (file-name-directory (directory-file-name dir)))))) 3134 (if (> (length (file-name-directory settings))
3134 result)) 3135 (length (car pda)))
3136 settings pda)
3137 (or settings pda))))
3135 3138
3136(defun project-define-from-project-file (settings-file) 3139(defun project-define-from-project-file (settings-file)
3137 "Load a settings file and register a new project class and instance. 3140 "Load a settings file and register a new project class and instance.