From 1254728338db225ec2672a2a59078cf28da5621c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 17 May 1993 22:18:34 +0000 Subject: (rmail-sortable-date-string): Handle date in format produced by current-time-string. --- lisp/mail/rmailsort.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'lisp/mail') diff --git a/lisp/mail/rmailsort.el b/lisp/mail/rmailsort.el index 2ad4277a41..182da0613e 100644 --- a/lisp/mail/rmailsort.el +++ b/lisp/mail/rmailsort.el @@ -198,8 +198,27 @@ Arguments are MSG and FIELD." (match-beginning 1) (match-end 1)))) ;; Time (substring date (match-beginning 4) (match-end 4))) + + ;; Handles this format Fri May 10 21:51:55 1991 + (if (string-match + " \\([a-z][a-z][a-z]\\) +\\([0-9]+\\) \\([0-9:]+\\) \\([0-9]+\\)" date) + (concat + ;; Year + (rmail-date-full-year + (substring date (match-beginning 4) (match-end 4))) + ;; Month + (cdr + (assoc + (upcase (substring date (match-beginning 1) (match-end 1))) month)) + ;; Day + (format "%2d" (string-to-int + (substring date + (match-beginning 2) (match-end 2)))) + ;; Time + (substring date (match-beginning 3) (match-end 3))) + ;; Cannot understand DATE string. - date))) + date)))) (defun rmail-date-full-year (year-string) (if (<= (length year-string) 2) -- cgit v1.2.3