From: hmurata Date: Sat, 9 Apr 2005 01:03:35 +0000 (+0000) Subject: * wl-util.el (wl-day-number): Abolish. X-Git-Tag: wl-2_15_3~88 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=529f99b0def9e4dafd5ff1b09ab9f620fbb3b651;p=elisp%2Fwanderlust.git * 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. * elmo-date.el (elmo-time-to-days): New function. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7bdfae2..3d02c5e 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,7 @@ +2005-04-09 Hiroya Murata + + * elmo-date.el (elmo-time-to-days): New function. + 2005-04-08 Hiroya Murata * elmo-util.el (elmo-map-recursive): Call `function' if `object' diff --git a/elmo/elmo-date.el b/elmo/elmo-date.el index 822dfef..215c36a 100644 --- a/elmo/elmo-date.el +++ b/elmo/elmo-date.el @@ -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)) diff --git a/wl/ChangeLog b/wl/ChangeLog index 549bf30..2fb55f8 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,15 @@ +2005-04-09 Hiroya Murata + + * 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 * wl-summary.el (wl-summary-print-message-with-ps-print): Call diff --git a/wl/wl-score.el b/wl/wl-score.el index 90cb5bc..e0a771d 100644 --- a/wl/wl-score.el +++ b/wl/wl-score.el @@ -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." diff --git a/wl/wl-util.el b/wl/wl-util.el index 71e8da1..227d7e3 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -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)