Commit a77b655d authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(locate-dominating-file): Accept non-existing argument.

(project-find-settings-file): Rewrite, using locate-dominating-file.
parent 4cd217dc
2008-05-22 Stefan Monnier <monnier@iro.umontreal.ca>
* files.el (locate-dominating-file): Accept non-existing argument.
(project-find-settings-file): Rewrite, using locate-dominating-file.
2008-05-22 Kenichi Handa <handa@m17n.org> 2008-05-22 Kenichi Handa <handa@m17n.org>
   
* faces.el (font-weight-table, font-slant-table) * faces.el (font-weight-table, font-slant-table, font-width-table):
(font-width-table): Delete them. Don't call Delete them. Don't call internal-set-font-style-table.
internal-set-font-style-table.
   
* international/mule-diag.el (font-show-log): New function. * international/mule-diag.el (font-show-log): New function.
   
* international/fontset.el (script-representative-chars): Add more * international/fontset.el (script-representative-chars): Add more
chars for latin. Add data for symbol. chars for latin. Add data for symbol.
(setup-default-fontset): Add entries for phonetic, armenian, and (setup-default-fontset): Add entries for phonetic, armenian, and symbol.
symbol.
   
2008-05-21 Stefan Monnier <monnier@iro.umontreal.ca> 2008-05-21 Stefan Monnier <monnier@iro.umontreal.ca>
   
......
...@@ -746,7 +746,8 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)." ...@@ -746,7 +746,8 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)."
(let ((prev-user user)) (let ((prev-user user))
(setq user (nth 2 (file-attributes file))) (setq user (nth 2 (file-attributes file)))
(or (null prev-user) (equal user prev-user)))) (or (null prev-user) (equal user prev-user))))
(if (setq files (directory-files dir 'full regexp)) (if (setq files (and (file-directory-p dir)
(directory-files dir 'full regexp)))
(throw 'found (car files)) (throw 'found (car files))
(if (equal dir (if (equal dir
(setq dir (file-name-directory (setq dir (file-name-directory
...@@ -3119,19 +3120,21 @@ If a settings file is found, the file name is returned. ...@@ -3119,19 +3120,21 @@ If a settings file is found, the file name is returned.
If the file is in a registered project, a cons from If the file is in a registered project, a cons from
`project-directory-alist' is returned. `project-directory-alist' is returned.
Otherwise this returns nil." Otherwise this returns nil."
(let ((dir (file-name-directory file)) (setq file (expand-file-name file))
(result nil)) (let* ((settings (locate-dominating-file file "\\`\\.dir-settings\\.el\\'"))
(while (and (not (string= dir "/")) (pda nil))
(not result)) ;; `locate-dominating-file' may have abbreviated the name.
(cond (if settings (setq settings (expand-file-name settings)))
((setq result (assoc dir project-directory-alist)) (dolist (x project-directory-alist)
;; Nothing else. (when (and (eq t (compare-strings file nil (length (car x))
nil) (car x) nil nil))
((file-exists-p (expand-file-name ".dir-settings.el" dir)) (> (length (car x)) (length (car pda))))
(setq result (expand-file-name ".dir-settings.el" dir))) (setq pda x)))
(t (if (and settings pda)
(setq dir (file-name-directory (directory-file-name dir)))))) (if (> (length (file-name-directory settings))
result)) (length (car pda)))
settings pda)
(or settings pda))))
(defun project-define-from-project-file (settings-file) (defun project-define-from-project-file (settings-file)
"Load a settings file and register a new project class and instance. "Load a settings file and register a new project class and instance.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment