From: ueno Date: Tue, 7 Dec 2004 10:12:14 +0000 (+0000) Subject: * test/test-riece-log.el (lunit-test-case-setup): #riece -> =23riece. X-Git-Tag: riece-1_0_7~112 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91038418eca873018eaf094f27e10698491c111f;p=elisp%2Friece.git * test/test-riece-log.el (lunit-test-case-setup): #riece -> =23riece. * riece-log.el (riece-log-insert): Renamed from riece-log-flashback-1; simplified. (riece-log-get-files): Check existence of directory. (riece-log-get-directory): New implementation. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8ec7cde..a363641 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,11 @@ 2004-12-07 Daiki Ueno + * test/test-riece-log.el (lunit-test-case-setup): #riece -> =23riece. + * riece-log.el (riece-log-insert): Renamed from riece-log-flashback-1; simplified. + (riece-log-get-files): Check existence of directory. + (riece-log-get-directory): New implementation. 2004-12-07 TAKAHASHI Kaoru diff --git a/lisp/riece-log.el b/lisp/riece-log.el index 738b2a5..3f2c9bc 100644 --- a/lisp/riece-log.el +++ b/lisp/riece-log.el @@ -94,32 +94,16 @@ If integer, flash back only this line numbers. t means all lines." (riece-log-get-directory identity))) (defun riece-log-get-files (identity) - (let ((files (directory-files (riece-log-get-directory identity) t - (concat "^" - (riece-make-interval-regexp "[0-9]" 8) - "\\.log$") - t))) - (nreverse (sort files #'string-lessp)))) + (let ((directory (riece-log-get-directory identity))) + (if (file-directory-p directory) + (nreverse (sort (directory-files directory t + (concat "^" + (riece-make-interval-regexp "[0-9]" 8) + "\\.log$") + t) + #'string-lessp))))) (defun riece-log-get-directory (identity) - (let ((channel (riece-identity-canonicalize-prefix - (riece-identity-prefix identity))) - (server (riece-identity-server identity)) - (map (assoc (riece-format-identity identity) riece-log-directory-map)) - name) - (cond (map (setq name (cdr map))) - ((string-match riece-strict-channel-regexp channel) - (let ((suffix (match-string 2 channel))) - (setq name (substring channel (match-end 1) (match-beginning 2))) - (when (and (stringp suffix) - (string-match "^:\\*\\.\\(.*\\)" suffix)) - (setq name (concat name "-" (match-string 1 suffix)))))) - (t (setq name "priv"))) - (if server - (expand-file-name name (expand-file-name server riece-log-directory)) - (expand-file-name name riece-log-directory)))) - -(defun riece-log-get-directory-1 (identity) (let ((prefix (riece-identity-canonicalize-prefix (riece-identity-prefix identity))) (server (riece-identity-server identity)) diff --git a/lisp/test/test-riece-log.el b/lisp/test/test-riece-log.el index 7e2f591..94bd81b 100644 --- a/lisp/test/test-riece-log.el +++ b/lisp/test/test-riece-log.el @@ -19,7 +19,7 @@ (temp-directory) temporary-file-directory)) test-riece-log-directory - (expand-file-name "riece" riece-log-directory)) + (expand-file-name "=23riece" riece-log-directory)) (make-directory riece-log-directory) (make-directory test-riece-log-directory) (write-region "03:14 a b c\n03:15 a b c\n" nil