From 232c7d4abc7b546c4c52bdeea2dc097a11ca7482 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Tue, 13 Dec 2005 00:02:27 +0000 Subject: [PATCH] muse-project: Deal with edge case. * lisp/muse-project.el (muse-project-file-alist): Try to fix edge case where file-name-directory returns nil, resulting in an error. Thanks to Paul Lussier for the report. git-archimport-id: mwolson@gnu.org--2005/muse--rel--3.02--patch-28 --- ChangeLog | 15 +++++++++++++++ lisp/muse-project.el | 20 +++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf95405..9f9941e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,21 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--rel--3.02 # +2005-12-13 00:02:27 GMT Michael Olson patch-28 + + Summary: + muse-project: Deal with edge case. + Revision: + muse--rel--3.02--patch-28 + + * lisp/muse-project.el (muse-project-file-alist): Try to fix edge case + where file-name-directory returns nil, resulting in an error. Thanks + to Paul Lussier for the report. + + modified files: + ChangeLog lisp/muse-project.el + + 2005-12-11 07:04:56 GMT Michael Olson patch-27 Summary: diff --git a/lisp/muse-project.el b/lisp/muse-project.el index 42927c9..6eeacd3 100644 --- a/lisp/muse-project.el +++ b/lisp/muse-project.el @@ -364,17 +364,19 @@ disk." (while pats (if (symbolp (car pats)) (setq pats (cddr pats)) - (let ((dir (or (and (file-directory-p (car pats)) (car pats)) - (and (not (file-readable-p (car pats))) - (file-directory-p - (file-name-directory (car pats))) - (file-name-directory (car pats)))))) - (if dir - (let ((mod-time (nth 5 (file-attributes dir)))) - (if (or (null last-mod) + (let* ((fnd (file-name-directory (car pats))) + (dir (cond ((file-directory-p (car pats)) + (car pats)) + ((and (not (file-readable-p (car pats))) + fnd + (file-directory-p fnd)) + fnd)))) + (when dir + (let ((mod-time (nth 5 (file-attributes dir)))) + (when (or (null last-mod) (and mod-time (muse-time-less-p last-mod mod-time))) - (setq last-mod mod-time))))) + (setq last-mod mod-time))))) (setq pats (cdr pats)))))) ;; Either return the currently known list, or read it again from ;; disk -- 2.11.4.GIT