Mercurial > emacs
comparison lisp/gnus/gnus-util.el @ 108949:234c5347118d
Synch with Gnus trunk.
2010-06-10 Dan Christensen <jdc@uwo.ca>
* gnus-util.el (gnus-user-date): Use gnus-date-get-time.
(gnus-dd-mmm): Use gnus-date-get-time.
* gnus-sum.el (gnus-thread-latest-date): Use gnus-date-get-time and
simplify logic.
(gnus-summary-limit-to-age): Use gnus-date-get-time.
(gnus-sort-threads): emit message if gnus-sort-threads-loop used.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Thu, 10 Jun 2010 00:30:13 +0000 |
parents | aacd4ee6c3af |
children | b7963ca9e06e |
comparison
equal
deleted
inserted
replaced
108948:c3f02c0c5924 | 108949:234c5347118d |
---|---|
453 seconds passed since the start of today, of this month, of this year, | 453 seconds passed since the start of today, of this month, of this year, |
454 respectively.") | 454 respectively.") |
455 | 455 |
456 (defun gnus-user-date (messy-date) | 456 (defun gnus-user-date (messy-date) |
457 "Format the messy-date according to gnus-user-date-format-alist. | 457 "Format the messy-date according to gnus-user-date-format-alist. |
458 Returns \" ? \" if there's bad input or if an other error occurs. | 458 Returns \" ? \" if there's bad input or if another error occurs. |
459 Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." | 459 Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." |
460 (condition-case () | 460 (condition-case () |
461 (let* ((messy-date (gnus-float-time (safe-date-to-time messy-date))) | 461 (let* ((messy-date (gnus-float-time (gnus-date-get-time messy-date))) |
462 (now (gnus-float-time)) | 462 (now (gnus-float-time)) |
463 ;;If we don't find something suitable we'll use this one | 463 ;;If we don't find something suitable we'll use this one |
464 (my-format "%b %d '%y")) | 464 (my-format "%b %d '%y")) |
465 (let* ((difference (- now messy-date)) | 465 (let* ((difference (- now messy-date)) |
466 (templist gnus-user-date-format-alist) | 466 (templist gnus-user-date-format-alist) |
475 (error " ? "))) | 475 (error " ? "))) |
476 | 476 |
477 (defun gnus-dd-mmm (messy-date) | 477 (defun gnus-dd-mmm (messy-date) |
478 "Return a string like DD-MMM from a big messy string." | 478 "Return a string like DD-MMM from a big messy string." |
479 (condition-case () | 479 (condition-case () |
480 (format-time-string "%d-%b" (safe-date-to-time messy-date)) | 480 (format-time-string "%d-%b" (gnus-date-get-time messy-date)) |
481 (error " - "))) | 481 (error " - "))) |
482 | 482 |
483 (defmacro gnus-date-get-time (date) | 483 (defmacro gnus-date-get-time (date) |
484 "Convert DATE string to Emacs time. | 484 "Convert DATE string to Emacs time. |
485 Cache the result as a text property stored in DATE." | 485 Cache the result as a text property stored in DATE." |