summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-util.el
diff options
context:
space:
mode:
authorRomain Francoise <romain@orebokech.com>2010-06-12 19:26:40 +0200
committerRomain Francoise <romain@orebokech.com>2010-06-12 19:26:40 +0200
commit89a13959ca5de71992328468028626cd3027798c (patch)
tree2d6c87066ef1b55cb754c76446bc06b1601b8140 /lisp/gnus/gnus-util.el
parent133a8d82eae71487045937d15c11264f28cd5507 (diff)
downloademacs-89a13959ca5de71992328468028626cd3027798c.tar.gz
emacs-89a13959ca5de71992328468028626cd3027798c.tar.bz2
emacs-89a13959ca5de71992328468028626cd3027798c.zip
Synch with Gnus trunk.
* gnus-util.el (gnus-date-get-time): Move up before first use.
Diffstat (limited to 'lisp/gnus/gnus-util.el')
-rw-r--r--lisp/gnus/gnus-util.el28
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 3045f72daeb..b8a1c266c93 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -429,6 +429,20 @@ TIME defaults to the current time."
(+ (car now) (* (car (cdr now)) 60) (* (car (nthcdr 2 now)) 3600)
(* (- (string-to-number days) 1) 3600 24))))
+(defmacro gnus-date-get-time (date)
+ "Convert DATE string to Emacs time.
+Cache the result as a text property stored in DATE."
+ ;; Either return the cached value...
+ `(let ((d ,date))
+ (if (equal "" d)
+ '(0 0)
+ (or (get-text-property 0 'gnus-time d)
+ ;; or compute the value...
+ (let ((time (safe-date-to-time d)))
+ ;; and store it back in the string.
+ (put-text-property 0 1 'gnus-time time d)
+ time)))))
+
(defvar gnus-user-date-format-alist
'(((gnus-seconds-today) . "%k:%M")
(604800 . "%a %k:%M") ;;that's one week
@@ -480,20 +494,6 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
(format-time-string "%d-%b" (gnus-date-get-time messy-date))
(error " - ")))
-(defmacro gnus-date-get-time (date)
- "Convert DATE string to Emacs time.
-Cache the result as a text property stored in DATE."
- ;; Either return the cached value...
- `(let ((d ,date))
- (if (equal "" d)
- '(0 0)
- (or (get-text-property 0 'gnus-time d)
- ;; or compute the value...
- (let ((time (safe-date-to-time d)))
- ;; and store it back in the string.
- (put-text-property 0 1 'gnus-time time d)
- time)))))
-
(defsubst gnus-time-iso8601 (time)
"Return a string of TIME in YYYYMMDDTHHMMSS format."
(format-time-string "%Y%m%dT%H%M%S" time))