diff options
| author | Richard M. Stallman | 1993-05-17 22:18:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-17 22:18:34 +0000 |
| commit | 1254728338db225ec2672a2a59078cf28da5621c (patch) | |
| tree | 894ff5d966a1a6c169d439fe17f0d6ba09b3983b | |
| parent | 66050f1032c6371333e6f0303de01c7022f908ef (diff) | |
| download | emacs-1254728338db225ec2672a2a59078cf28da5621c.tar.gz emacs-1254728338db225ec2672a2a59078cf28da5621c.zip | |
(rmail-sortable-date-string): Handle date in format
produced by current-time-string.
| -rw-r--r-- | lisp/mail/rmailsort.el | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lisp/mail/rmailsort.el b/lisp/mail/rmailsort.el index 2ad4277a41d..182da0613ef 100644 --- a/lisp/mail/rmailsort.el +++ b/lisp/mail/rmailsort.el | |||
| @@ -198,8 +198,27 @@ Arguments are MSG and FIELD." | |||
| 198 | (match-beginning 1) (match-end 1)))) | 198 | (match-beginning 1) (match-end 1)))) |
| 199 | ;; Time | 199 | ;; Time |
| 200 | (substring date (match-beginning 4) (match-end 4))) | 200 | (substring date (match-beginning 4) (match-end 4))) |
| 201 | |||
| 202 | ;; Handles this format Fri May 10 21:51:55 1991 | ||
| 203 | (if (string-match | ||
| 204 | " \\([a-z][a-z][a-z]\\) +\\([0-9]+\\) \\([0-9:]+\\) \\([0-9]+\\)" date) | ||
| 205 | (concat | ||
| 206 | ;; Year | ||
| 207 | (rmail-date-full-year | ||
| 208 | (substring date (match-beginning 4) (match-end 4))) | ||
| 209 | ;; Month | ||
| 210 | (cdr | ||
| 211 | (assoc | ||
| 212 | (upcase (substring date (match-beginning 1) (match-end 1))) month)) | ||
| 213 | ;; Day | ||
| 214 | (format "%2d" (string-to-int | ||
| 215 | (substring date | ||
| 216 | (match-beginning 2) (match-end 2)))) | ||
| 217 | ;; Time | ||
| 218 | (substring date (match-beginning 3) (match-end 3))) | ||
| 219 | |||
| 201 | ;; Cannot understand DATE string. | 220 | ;; Cannot understand DATE string. |
| 202 | date))) | 221 | date)))) |
| 203 | 222 | ||
| 204 | (defun rmail-date-full-year (year-string) | 223 | (defun rmail-date-full-year (year-string) |
| 205 | (if (<= (length year-string) 2) | 224 | (if (<= (length year-string) 2) |