* wl-util.el (wl-day-number): Abolish.
authorhmurata <hmurata>
Sat, 9 Apr 2005 01:03:35 +0000 (01:03 +0000)
committerhmurata <hmurata>
Sat, 9 Apr 2005 01:03:35 +0000 (01:03 +0000)
* wl-score.el (wl-score-headers): Use `elmo-time-to-days' instead
of `wl-day-number'.
(wl-score-followup): Ditto.
(wl-score-add-followups): Ditto.
(wl-score-get-latest-msgs): Ditto.
(wl-score-get-header-entry): Ditto.
(wl-score-edit-insert-date): Ditto.

* elmo-date.el (elmo-time-to-days): New function.

elmo/ChangeLog
elmo/elmo-date.el
wl/ChangeLog
wl/wl-score.el
wl/wl-util.el

index 7bdfae2..3d02c5e 100644 (file)
@@ -1,3 +1,7 @@
+2005-04-09  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo-date.el (elmo-time-to-days): New function.
+
 2005-04-08  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * elmo-util.el (elmo-map-recursive): Call `function' if `object'
index 822dfef..215c36a 100644 (file)
@@ -235,6 +235,11 @@ Otherwise treat \\ in NEWTEXT string as special:
           (setq rhs nil))))
   (not (null rhs)))
 
+(defun elmo-time-to-days (time)
+  (let ((date (decode-time time)))
+    (timezone-absolute-from-gregorian
+     (nth 4 date) (nth 3 date) (nth 5 date))))
+
 (require 'product)
 (product-provide (provide 'elmo-date) (require 'elmo-version))
 
index 549bf30..2fb55f8 100644 (file)
@@ -1,3 +1,15 @@
+2005-04-09  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * wl-util.el (wl-day-number): Abolish.
+
+       * wl-score.el (wl-score-headers): Use `elmo-time-to-days' instead
+       of `wl-day-number'.
+       (wl-score-followup): Ditto.
+       (wl-score-add-followups): Ditto.
+       (wl-score-get-latest-msgs): Ditto.
+       (wl-score-get-header-entry): Ditto.
+       (wl-score-edit-insert-date): Ditto.
+
 2005-04-08  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-summary.el (wl-summary-print-message-with-ps-print): Call
index 90cb5bc..e0a771d 100644 (file)
@@ -367,7 +367,7 @@ Set `wl-score-cache' nil."
 (defun wl-score-headers (scores &optional force-msgs not-add)
   (let* ((elmo-mime-charset wl-summary-buffer-mime-charset)
         (folder wl-summary-buffer-elmo-folder)
-        (now (wl-day-number (current-time-string)))
+        (now (elmo-time-to-days (current-time)))
         (expire (and wl-score-expiry-days
                      (- now wl-score-expiry-days)))
         (wl-score-stop-add-entry not-add)
@@ -754,10 +754,9 @@ Set `wl-score-cache' nil."
                               expire
                               (< expire
                                  (setq day
-                                       (wl-day-number
-                                        (elmo-time-make-date-string
-                                         (elmo-message-entity-field
-                                          (car art) 'date)))))))
+                                       (elmo-time-to-days
+                                        (elmo-message-entity-field
+                                         (car art) 'date))))))
                  (when (setq new (wl-score-add-followups
                                   (car art) score all-scores alist thread
                                   day))
@@ -793,7 +792,7 @@ Set `wl-score-cache' nil."
             (setq dont t)))
       (unless dont
        (let ((entry (list id score
-                          (or day (wl-day-number (current-time-string))) 's)))
+                          (or day (elmo-time-to-days (current-time))) 's)))
          (unless (or thread wl-score-stop-add-entry)
            (wl-score-update-score-entry "references" entry alist))
          (wl-score-set 'touched '(t) alist)
@@ -893,7 +892,7 @@ Set `wl-score-cache' nil."
     (wl-summary-score-effect (car entry) list (eq (nth 2 list) 'now)))))
 
 (defun wl-score-get-latest-msgs ()
-  (let* ((now (wl-day-number (current-time-string)))
+  (let* ((now (elmo-time-to-days (current-time)))
         (expire (and wl-score-expiry-days
                      (- now wl-score-expiry-days)))
         (rnumbers (reverse wl-summary-buffer-number-list))
@@ -903,12 +902,10 @@ Set `wl-score-cache' nil."
                                   nil t)
       (catch 'break
        (while rnumbers
-         (if (< (wl-day-number
-                 (elmo-time-make-date-string
-                  (elmo-message-entity-field
-                   (elmo-message-entity wl-summary-buffer-elmo-folder
-                                        (car rnumbers))
-                   'date)))
+         (if (< (elmo-time-to-days
+                 (elmo-message-entity-field wl-summary-buffer-elmo-folder
+                                            (car rnumbers)
+                                            'date))
                 expire)
              (throw 'break t))
          (wl-push (car rnumbers) msgs)
@@ -1077,7 +1074,7 @@ Set `wl-score-cache' nil."
           (perm (cond ((eq perm 'perm)
                        nil)
                       ((eq perm 'temp)
-                       (wl-day-number (current-time-string)))
+                       (elmo-time-to-days (current-time)))
                       ((eq perm 'now)
                        perm)))
           (new (list match score perm type extra)))
@@ -1323,7 +1320,7 @@ Entering Score mode calls the value of `wl-score-mode-hook'."
 (defun wl-score-edit-insert-date ()
   "Insert date in numerical format."
   (interactive)
-  (princ (wl-day-number (current-time-string)) (current-buffer)))
+  (princ (elmo-time-to-days (current-time)) (current-buffer)))
 
 (defun wl-score-pretty-print ()
   "Format the current score file."
index 71e8da1..227d7e3 100644 (file)
@@ -447,12 +447,6 @@ that `read' can handle, whenever this is possible."
       (wl-get-date-iso8601 date)
     (error "")))
 
-(defun wl-day-number (date)
-  (let ((dat (mapcar '(lambda (s) (and s (string-to-int s)) )
-                    (timezone-parse-date date))))
-    (timezone-absolute-from-gregorian
-     (nth 1 dat) (nth 2 dat) (car dat))))
-
 (defun wl-url-news (url &rest args)
   (interactive "sURL: ")
   (if (string-match "^news:\\(.*\\)$" url)