+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>
- * faces.el (font-weight-table, font-slant-table)
- (font-width-table): Delete them. Don't call
- internal-set-font-style-table.
+ * faces.el (font-weight-table, font-slant-table, font-width-table):
+ Delete them. Don't call internal-set-font-style-table.
* international/mule-diag.el (font-show-log): New function.
* international/fontset.el (script-representative-chars): Add more
chars for latin. Add data for symbol.
- (setup-default-fontset): Add entries for phonetic, armenian, and
- symbol.
+ (setup-default-fontset): Add entries for phonetic, armenian, and symbol.
2008-05-21 Stefan Monnier <monnier@iro.umontreal.ca>
(let ((prev-user user))
(setq user (nth 2 (file-attributes file)))
(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))
(if (equal dir
(setq dir (file-name-directory
If the file is in a registered project, a cons from
`project-directory-alist' is returned.
Otherwise this returns nil."
- (let ((dir (file-name-directory file))
- (result nil))
- (while (and (not (string= dir "/"))
- (not result))
- (cond
- ((setq result (assoc dir project-directory-alist))
- ;; Nothing else.
- nil)
- ((file-exists-p (expand-file-name ".dir-settings.el" dir))
- (setq result (expand-file-name ".dir-settings.el" dir)))
- (t
- (setq dir (file-name-directory (directory-file-name dir))))))
- result))
+ (setq file (expand-file-name file))
+ (let* ((settings (locate-dominating-file file "\\`\\.dir-settings\\.el\\'"))
+ (pda nil))
+ ;; `locate-dominating-file' may have abbreviated the name.
+ (if settings (setq settings (expand-file-name settings)))
+ (dolist (x project-directory-alist)
+ (when (and (eq t (compare-strings file nil (length (car x))
+ (car x) nil nil))
+ (> (length (car x)) (length (car pda))))
+ (setq pda x)))
+ (if (and settings pda)
+ (if (> (length (file-name-directory settings))
+ (length (car pda)))
+ settings pda)
+ (or settings pda))))
(defun project-define-from-project-file (settings-file)
"Load a settings file and register a new project class and instance.