Synch up with main trunk. wl-2_14
authoryoichi <yoichi>
Sat, 22 Apr 2006 03:31:54 +0000 (03:31 +0000)
committeryoichi <yoichi>
Sat, 22 Apr 2006 03:31:54 +0000 (03:31 +0000)
elmo/ChangeLog
elmo/elmo-maildir.el

index bc88c21..72ff92a 100644 (file)
@@ -1,3 +1,15 @@
+2006-04-21  Yoichi NAKAYAMA  <yoichi@geiin.org>
+
+       * elmo-maildir.el (elmo-maildir-list-location): Reduce
+       `elmo-get-last-modification-time' call.
+
+2006-04-13  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo-maildir.el (elmo-maildir-list-location): Fixed a regular
+       expression.
+       (elmo-maildir-set-mark): Ditto.
+       (elmo-maildir-delete-mark): Ditto.
+
 2005-04-05  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo-maildir.el (elmo-maildir-sequence-number): New function.
index 9632959..8fa8e32 100644 (file)
@@ -110,43 +110,44 @@ LOCATION."
 
 (defsubst elmo-maildir-list-location (dir &optional child-dir)
   (let* ((cur-dir (expand-file-name (or child-dir "cur") dir))
-        (cur (directory-files cur-dir
-                              nil "^[^.].*$" t))
+        (cur (mapcar (lambda (x)
+                       (cons x (elmo-get-last-modification-time
+                                (expand-file-name x cur-dir))))
+                     (directory-files cur-dir
+                                      nil "^[^.].*$" t)))
+        (regexp (elmo-maildir-adjust-separator "^\\(.+\\):[12],\\(.*\\)$"))
         unread-locations flagged-locations answered-locations
         sym locations flag-list x-time y-time)
     (setq cur (sort cur
                    (lambda (x y)
-                     (setq x-time (elmo-get-last-modification-time
-                                   (expand-file-name x cur-dir))
-                           y-time (elmo-get-last-modification-time
-                                   (expand-file-name y cur-dir)))
+                     (setq x-time (cdr x)
+                           y-time (cdr y))
                      (cond
                       ((< x-time y-time)
                        t)
                       ((eq x-time y-time)
-                       (< (elmo-maildir-sequence-number x)
-                          (elmo-maildir-sequence-number y)))))))
+                       (< (elmo-maildir-sequence-number (car x))
+                          (elmo-maildir-sequence-number (car y))))))))
     (setq locations
          (mapcar
           (lambda (x)
-            (if (string-match
-                 (elmo-maildir-adjust-separator "^\\([^:]+\\):\\([^:]+\\)$")
-                 x)
-                (progn
-                  (setq sym (elmo-match-string 1 x)
-                        flag-list (string-to-char-list
-                                   (elmo-match-string 2 x)))
-                  (when (memq ?F flag-list)
-                    (setq flagged-locations
-                          (cons sym flagged-locations)))
-                  (when (memq ?R flag-list)
-                    (setq answered-locations
-                          (cons sym answered-locations)))
-                  (unless (memq ?S flag-list)
-                    (setq unread-locations
-                          (cons sym unread-locations)))
-                  sym)
-              x))
+            (let ((name (car x)))
+              (if (string-match regexp name)
+                  (progn
+                    (setq sym (elmo-match-string 1 name)
+                          flag-list (string-to-char-list
+                                     (elmo-match-string 2 name)))
+                    (when (memq ?F flag-list)
+                      (setq flagged-locations
+                            (cons sym flagged-locations)))
+                    (when (memq ?R flag-list)
+                      (setq answered-locations
+                            (cons sym answered-locations)))
+                    (unless (memq ?S flag-list)
+                      (setq unread-locations
+                            (cons sym unread-locations)))
+                    sym)
+                name)))
           cur))
     (list locations unread-locations flagged-locations answered-locations)))
 
@@ -300,7 +301,7 @@ LOCATION."
 (defun elmo-maildir-set-mark (filename mark)
   "Mark the FILENAME file in the maildir.  MARK is a character."
   (if (string-match
-       (elmo-maildir-adjust-separator "^\\([^:]+:[12],\\)\\(.*\\)$")
+       (elmo-maildir-adjust-separator "^\\(.+:[12],\\)\\(.*\\)$")
        filename)
       (let ((flaglist (string-to-char-list (elmo-match-string
                                            2 filename))))
@@ -318,7 +319,7 @@ LOCATION."
 
 (defun elmo-maildir-delete-mark (filename mark)
   "Mark the FILENAME file in the maildir.  MARK is a character."
-  (if (string-match (elmo-maildir-adjust-separator "^\\([^:]+:2,\\)\\(.*\\)$")
+  (if (string-match (elmo-maildir-adjust-separator "^\\(.+:2,\\)\\(.*\\)$")
                    filename)
       (let ((flaglist (string-to-char-list (elmo-match-string
                                            2 filename))))