[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 8c13e84978 1/7: Fix newsticker timezone decode
From: |
Paul Eggert |
Subject: |
master 8c13e84978 1/7: Fix newsticker timezone decode |
Date: |
Fri, 30 Dec 2022 00:32:26 -0500 (EST) |
branch: master
commit 8c13e8497821881b5197a1717e9e53b9991859d0
Author: LdBeth <andpuke@foxmail.com>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Fix newsticker timezone decode
'newsticker--decode-rfc822-date' has the regex pattern for
North American timezones but the actual timezone conversion
for them was not implmented. Now cond cases are added to
handle them as specified in RFC822.
Copyright-paperwork-exempt: yes
---
lisp/net/newst-backend.el | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index af196ccecf..2a87742fdf 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -1623,7 +1623,7 @@ Sat, 07 Sep 2002 00:00:01 GMT
":\\([0-9]\\{2\\}\\)"
;; second
"\\(:\\([0-9]\\{2\\}\\)\\)?"
- ;; zone -- fixme
+ ;; zone
"\\(\\s-+\\("
"UT\\|GMT\\|EST\\|EDT\\|CST\\|CDT\\|MST\\|MDT\\|PST\\|PDT"
"\\|\\([-+]\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)"
@@ -1642,16 +1642,26 @@ Sat, 07 Sep 2002 00:00:01 GMT
(offset-hour (read (or (match-string 14 rfc822-string)
"0")))
(offset-minute (read (or (match-string 15 rfc822-string)
- "0")))
- ;;FIXME
- )
+ "0"))))
(when zone
(cond ((string= sign "+")
(setq hour (- hour offset-hour))
(setq minute (- minute offset-minute)))
((string= sign "-")
(setq hour (+ hour offset-hour))
- (setq minute (+ minute offset-minute)))))
+ (setq minute (+ minute offset-minute)))
+ ((or (string= zone "UT") (string= zone "GMT"))
+ nil)
+ ((string= zone "EDT")
+ (setq hour (+ hour 4)))
+ ((or (string= zone "EST") (string= zone "CDT"))
+ (setq hour (+ hour 5)))
+ ((or (string= zone "CST") (string= zone "MDT"))
+ (setq hour (+ hour 6)))
+ ((or (string= zone "MST") (string= zone "PDT"))
+ (setq hour (+ hour 7)))
+ ((string= zone "PST")
+ (setq hour (+ hour 8)))))
(condition-case error-data
(let ((i 1))
(dolist (m '("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug"
- master updated (91ae9f3d12 -> 9153cf8158), Paul Eggert, 2022/12/30
- master 523261b454 6/7: Document calc-time-zone abbreviation obsolescence, Paul Eggert, 2022/12/30
- master 007e66bccb 5/7: Use RFC 822 abbrevs in sunrise-sunset strings, Paul Eggert, 2022/12/30
- master 8c13e84978 1/7: Fix newsticker timezone decode,
Paul Eggert <=
- master 73769dc2b8 2/7: In cal-dst, be consistent re default to UTC, Paul Eggert, 2022/12/30
- master bc4cbbcc57 4/7: Add nndiary-headers obsolescence comment, Paul Eggert, 2022/12/30
- master d11e34ce76 3/7: Default mbox "From " time zone to -0000, Paul Eggert, 2022/12/30
- master 9153cf8158 7/7: Avoid some obsolescent tz abbrevs in doc., Paul Eggert, 2022/12/30