From bcafb09a3de46c61042fb189f35ecaf9193a8333 Mon Sep 17 00:00:00 2001 From: murata Date: Sat, 7 Apr 2001 14:47:15 +0000 Subject: [PATCH] * elmo-archive.el (elmo-archive-folder-list-subfolders): Match exactly folder list. (elmo-folder-append-messages): Fixed append archive with prefix. * elmo-localdir.el (elmo-folder-message-make-temp-files): Fixed make temp files with start-number. * elmo-pipe.el (elmo-folder-message-make-temp-file-p): Fixed typo. --- elmo/ChangeLog | 11 +++++++++++ elmo/elmo-archive.el | 28 +++++++++++++++++++--------- elmo/elmo-localdir.el | 7 ++++--- elmo/elmo-pipe.el | 2 +- 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7e6a514..791c350 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,14 @@ +2001-04-07 Masahiro MURATA + + * elmo-archive.el (elmo-archive-folder-list-subfolders): Match + exactly folder list. + (elmo-folder-append-messages): Fixed append archive with prefix. + + * elmo-localdir.el (elmo-folder-message-make-temp-files): Fixed + make temp files with start-number. + + * elmo-pipe.el (elmo-folder-message-make-temp-file-p): Fixed typo. + 2001-04-05 Hiroya Murata * elmo.el (elmo-folder-list-messages-internal): Fixed lucking optional diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index 99afe7a..ab3fa90 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -485,7 +485,9 @@ TYPE specifies the archiver's symbol." (name (if (file-directory-p path) "" (file-name-nondirectory path))) (flist (and (file-directory-p dir) - (directory-files dir nil name nil))) + (directory-files dir nil + (concat "^" name "[^A-z][^A-z]") + nil))) (regexp (format "^\\(.*\\)\\(%s\\)$" (mapconcat '(lambda (x) (regexp-quote (cdr x))) @@ -494,8 +496,7 @@ TYPE specifies the archiver's symbol." (if (string-match "\\(.*\\)/$" base-folder) ; ends with '/'. (setq base-folder (elmo-match-string 1 base-folder)) (unless (file-directory-p path) - (setq base-folder (or (file-name-directory base-folder) - base-folder)))) + (setq base-folder (or (file-name-directory base-folder) "")))) (delq nil (mapcar @@ -594,9 +595,10 @@ TYPE specifies the archiver's symbol." (luna-define-method elmo-folder-append-messages :around ((folder elmo-archive-folder) src-folder numbers unread-marks &optional same-number) + (let ((prefix (elmo-archive-folder-archive-prefix-internal folder))) (cond ((and same-number - (null (elmo-archive-folder-archive-prefix-internal folder)) + (null prefix) (elmo-folder-message-file-p src-folder) (elmo-folder-message-file-number-p src-folder)) ;; same-number(localdir, localnews) -> archive @@ -613,24 +615,32 @@ TYPE specifies the archiver's symbol." (1+ (if (file-exists-p (elmo-archive-get-archive-name folder)) (car (elmo-folder-status folder)) 0))))) - new-dir base-dir) + new-dir base-dir files) (setq base-dir temp-dir) - (when (> (length (elmo-archive-folder-archive-prefix-internal folder)) 0) + (when (> (length prefix) 0) + (when (file-name-directory prefix) + (elmo-make-directory (file-name-directory prefix))) (rename-file temp-dir (setq new-dir (expand-file-name - (elmo-archive-folder-archive-prefix-internal folder) + prefix ;; parent of temp-dir..(works in windows?) (expand-file-name ".." temp-dir)))) ;; now temp-dir has name prefix. (setq temp-dir new-dir) ;; parent of prefix becomes base-dir. (setq base-dir (expand-file-name ".." temp-dir))) - (if (elmo-archive-append-files folder base-dir) + (setq files + (mapcar + '(lambda (x) (elmo-concat-path prefix x)) + (directory-files temp-dir nil "^[^\\.]"))) + (if (elmo-archive-append-files folder + base-dir + files) (elmo-delete-directory temp-dir))) numbers) - (t (luna-call-next-method)))) + (t (luna-call-next-method))))) (luna-define-method elmo-folder-message-make-temp-file-p ((folder elmo-archive-folder)) diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index e64360d..d44e8fa 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -122,15 +122,16 @@ &optional start-number) (let ((temp-dir (elmo-folder-make-temp-dir folder)) - (cur-number (if start-number 0))) + (cur-number (or start-number 0))) (dolist (number numbers) (elmo-add-name-to-file (expand-file-name (int-to-string number) (elmo-localdir-folder-directory-internal folder)) (expand-file-name - (int-to-string (if start-number (incf cur-number) number)) - temp-dir))) + (int-to-string (if start-number cur-number number)) + temp-dir)) + (incf cur-number)) temp-dir)) (defun elmo-localdir-msgdb-create-entity (dir number) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index bf99778..b708d1e 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -196,7 +196,7 @@ (elmo-pipe-folder-dst-internal folder))) (luna-define-method elmo-folder-message-make-temp-file-p - ((folder elmo-localdir-folder)) + ((folder elmo-pipe-folder)) (elmo-folder-message-make-temp-file-p (elmo-pipe-folder-dst-internal folder))) -- 1.7.10.4