From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2016 03:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 25086@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148065042624915 (code B ref -1); Fri, 02 Dec 2016 03:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Dec 2016 03:47:06 +0000 Received: from localhost ([127.0.0.1]:49304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCeoU-0006Tn-0R for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:47:06 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCeoS-0006TJ-Hc for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:47:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCeoM-0006gc-9U for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:46:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCeoM-0006gF-6f for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:46:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCeoK-0001nx-TD for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:46:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCeoH-0006bN-OY for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:46:56 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21459) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCeoH-0006aw-Eu for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:46:53 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1480650408710973.6395530284094; Thu, 1 Dec 2016 19:46:48 -0800 (PST) From: Hong Xu Date: Thu, 1 Dec 2016 19:46:48 -0800 Message-Id: <1480650408-26252-1-git-send-email-hong@topbug.net> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) * parse-time.el (parse-iso8601-time-string): Fix its timezone parsing. * parse-time.el: Add doc for parse-iso8601-time-string and make it autoload. * editfns.c (Fdecode-time): Minor doc improvement for decode-time. --- doc/misc/emacs-mime.texi | 3 +++ lisp/calendar/parse-time.el | 12 ++++++++---- src/editfns.c | 5 ++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 4d68246bba4b..8d6536265416 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -1536,6 +1536,9 @@ time-date (date-to-time "Sat Sep 12 12:21:54 1998 +0200") @result{} (13818 19266) +(parse-iso8601-time-string "1998-09-12T12:21:54+0200") +@result{} (13818 19266) + (float-time '(13818 19266)) @result{} 905595714.0 diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 6ba26a4a00d0..bc1efbb074e3 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -195,7 +195,7 @@ parse-time-iso8601-regexp (time-minute 2digit) (time-second 2digit) (time-secfrac "\\(\\.[0-9]+\\)?") - (time-numoffset (concat "[-+]\\(" time-hour "\\):" time-minute)) + (time-numoffset (concat "\\([-+]" time-hour "\\):?" time-minute)) (time-offset (concat "Z" time-numoffset)) (partial-time (concat time-hour colon time-minute colon time-second time-secfrac)) @@ -204,13 +204,17 @@ parse-time-iso8601-regexp (date-time (concat full-date "T" full-time))) (list (concat "^" full-date) (concat "T" partial-time) - (concat "Z" time-numoffset))) + (concat "Z?" time-numoffset))) "List of regular expressions matching ISO 8601 dates. 1st regular expression matches the date. 2nd regular expression matches the time. 3rd regular expression matches the (optional) timezone specification.") +;;;###autoload (defun parse-iso8601-time-string (date-string) + "Parse an ISO 8601 time string, such as 2016-12-01T23:35:06-05:00. +If DATE-STRING cannot be parsed, it falls back to +`parse-time-string'." (let* ((date-re (nth 0 parse-time-iso8601-regexp)) (time-re (nth 1 parse-time-iso8601-regexp)) (tz-re (nth 2 parse-time-iso8601-regexp)) @@ -235,10 +239,10 @@ parse-iso8601-time-string "0")) re-start (match-end 0)) (when (string-match tz-re date-string re-start) - (setq tz (match-string 1 date-string))) + (setq tz (* 3600 (string-to-number (match-string 1 date-string))))) (setq time (list seconds minute hour day month year day-of-week dst tz)))) - ;; Fall back to having Gnus do fancy things for us. + ;; Fall back to having `parse-time-string' do fancy things for us. (when (not time) (setq time (parse-time-string date-string))) diff --git a/src/editfns.c b/src/editfns.c index 5cc4a67ab19b..2f1f412d9e4e 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2101,9 +2101,8 @@ format_time_string (char const *format, ptrdiff_t formatlen, DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 2, 0, doc: /* Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW DST UTCOFF). -The optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED), -as from `current-time' and `file-attributes', or nil to use the -current time. +The optional TIME should be a list of (HIGH LOW . IGNORED), as from +`current-time' and `file-attributes', or nil to use the current time. It can also be a single integer number of seconds since the epoch. The obsolete form (HIGH . LOW) is also still accepted. The optional ZONE is omitted or nil for Emacs local time, t for -- 2.1.4 From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2016 03:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 25086@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148065096025694 (code B ref -1); Fri, 02 Dec 2016 03:56:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Dec 2016 03:56:00 +0000 Received: from localhost ([127.0.0.1]:49309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCex6-0006gL-0Y for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:56:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCex4-0006g8-Ba for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:55:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCewy-0002hc-BL for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:55:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_20,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCewy-0002hP-7t for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:55:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCewx-0002oH-C9 for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:55:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCews-0002dx-Hh for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:55:51 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21498) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCews-0002cg-4l for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:55:46 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 148065094158184.87861715356814; Thu, 1 Dec 2016 19:55:41 -0800 (PST) References: <1480650408-26252-1-git-send-email-hong@topbug.net> User-agent: mu4e 0.9.17; emacs 25.1.90.4 From: Hong Xu In-reply-to: <1480650408-26252-1-git-send-email-hong@topbug.net> Date: Thu, 01 Dec 2016 19:55:37 -0800 Message-ID: <874m2nyog6.fsf@topbug.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Zoho-Virus-Status: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) --=-=-= Content-Type: text/plain On 2016-12-01 Thu 19:46 GMT-0800, Hong Xu wrote: > * parse-time.el (parse-iso8601-time-string): Fix its timezone > parsing. > * parse-time.el: Add doc for parse-iso8601-time-string and > make it autoload. > * editfns.c (Fdecode-time): Minor doc improvement for decode-time. I should have noted that the current version basically cannot parse the timezone at all. To reproduce, try the following: (format-time-string "%H %M %S" (parse-iso8601-time-string "1998-09-12T12:21:54-0200") t) Also missed one line: * emacs-mime.texi (time-date): Add an example for parse-iso8601-time-string. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYQPC5AAoJECZsfTOCL4R4s1EQALYYJXh5RheJ9WKOaQR8QtYX KWA71f+SV2s8iQC2vcPqQrmm2psXxrX34flbnAz+zbHRVLJshPEhlWeVSM84VIap 4VxxLuHQHOT7WMco+/JQOJ7mjqPq8yaiezrrNawiE7WwQ5Rlq8MGVr8jN+G5zvdj E1Xgdx8Ozvuhsacn9gKjM1cFfPjHYzFy0vedJYmKfcO8DVdqoS+bZrOBS1v8byrz DAut/PlIuJfFCQXOHTCkj7kmIj5FCEa7J0VNuhseJc8QGJtkrIIn8IYXCSMn8gdg sYm8W9NKD4l9jthxMoKUNfN8r+Iy8uBol+a73kdxxNCnt1h6TOIb9Aab0+ABvc6A 5D3mtvAVsRCBecyzSLwd6w6eQW8lmPvbgm73rfF2alzuaEqMbmfWE0l7NnTQn+Zq 0DSZLlND/BPPpin4AUNumre2Lcpb9WHivAHxgyWf+THkLHFe3PLWcsBHxVX5pU36 nAEwaEyWGfglNKak6if0FDdZ6W1U2i4R0TqjeTTN9FGPg00ofmWslIzP8dD8Ay6s vCjteFyaNizdGJjGEwgq7o6dxmeFP4/LfzhK6gX/K36sodCiyvNEzJcyrpE2W/ST j2gSUv0TdvZhz+9D4K+SaixODSXkqgoM+GLGIzXnmbJQfVerVW7n6LQ1vqsN+QRT lzLeZFA21QDSMSElsvWg =JUVa -----END PGP SIGNATURE----- --=-=-=-- From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2016 04:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 25086@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148065145926505 (code B ref -1); Fri, 02 Dec 2016 04:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Dec 2016 04:04:19 +0000 Received: from localhost ([127.0.0.1]:49326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCf59-0006tR-52 for submit@debbugs.gnu.org; Thu, 01 Dec 2016 23:04:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCf57-0006tC-BJ for submit@debbugs.gnu.org; Thu, 01 Dec 2016 23:04:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCf50-0007S7-Pj for submit@debbugs.gnu.org; Thu, 01 Dec 2016 23:04:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCf50-0007Rt-N3 for submit@debbugs.gnu.org; Thu, 01 Dec 2016 23:04:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCf4z-0005Gf-74 for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 23:04:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCf4v-0007Pc-7L for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 23:04:09 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCf4u-0007P1-SI for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 23:04:05 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 148065144150068.11165459871756; Thu, 1 Dec 2016 20:04:01 -0800 (PST) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> User-agent: mu4e 0.9.17; emacs 25.1.90.4 From: Hong Xu In-reply-to: <874m2nyog6.fsf@topbug.net> Date: Thu, 01 Dec 2016 20:04:00 -0800 Message-ID: <8737i7yo27.fsf@topbug.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Zoho-Virus-Status: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2016-12-01 Thu 19:55 GMT-0800, Hong Xu wrote: > On 2016-12-01 Thu 19:46 GMT-0800, Hong Xu wrote: > >> * parse-time.el (parse-iso8601-time-string): Fix its timezone >> parsing. >> * parse-time.el: Add doc for parse-iso8601-time-string and >> make it autoload. >> * editfns.c (Fdecode-time): Minor doc improvement for decode-time. > > I should have noted that the current version basically cannot parse the > timezone at all. To reproduce, try the following: > > (format-time-string "%H %M %S" > (parse-iso8601-time-string "1998-09-12T12:21:54-0200") t) > > > Also missed one line: > > * emacs-mime.texi (time-date): Add an example for parse-iso8601-time-string. I've now updated the patch and put everything together, as attached. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-the-timezone-detection-of-parse-iso8601-time-str.patch Content-Transfer-Encoding: quoted-printable [PATCH] Fix the timezone detection of parse-iso8601-time-string. * parse-time.el (parse-iso8601-time-string): Fix its timezone parsing. * parse-time.el: Add doc for parse-iso8601-time-string and make it autoload. * editfns.c (Fdecode-time): Minor doc improvement for decode-time. * emacs-mime.texi (time-date): Add an example for parse-iso8601-time-string. =2D-- doc/misc/emacs-mime.texi | 3 +++ lisp/calendar/parse-time.el | 12 ++++++++---- src/editfns.c | 5 ++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 4d68246bba4b..8d6536265416 100644 =2D-- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -1536,6 +1536,9 @@ time-date (date-to-time "Sat Sep 12 12:21:54 1998 +0200") @result{} (13818 19266) =20 +(parse-iso8601-time-string "1998-09-12T12:21:54+0200") +@result{} (13818 19266) + (float-time '(13818 19266)) @result{} 905595714.0 =20 diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 6ba26a4a00d0..e9dac0149b10 100644 =2D-- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -195,7 +195,7 @@ parse-time-iso8601-regexp (time-minute 2digit) (time-second 2digit) (time-secfrac "\\(\\.[0-9]+\\)?") =2D (time-numoffset (concat "[-+]\\(" time-hour "\\):" time-minute)) + (time-numoffset (concat "\\([-+]" time-hour "\\):?" time-minute "?")) (time-offset (concat "Z" time-numoffset)) (partial-time (concat time-hour colon time-minute colon time-second time-secfrac)) @@ -204,13 +204,17 @@ parse-time-iso8601-regexp (date-time (concat full-date "T" full-time))) (list (concat "^" full-date) (concat "T" partial-time) =2D (concat "Z" time-numoffset))) + (concat "Z?" time-numoffset))) "List of regular expressions matching ISO 8601 dates. 1st regular expression matches the date. 2nd regular expression matches the time. 3rd regular expression matches the (optional) timezone specification.") =20 +;;;###autoload (defun parse-iso8601-time-string (date-string) + "Parse an ISO 8601 time string, such as 2016-12-01T23:35:06-05:00. +If DATE-STRING cannot be parsed, it falls back to +`parse-time-string'." (let* ((date-re (nth 0 parse-time-iso8601-regexp)) (time-re (nth 1 parse-time-iso8601-regexp)) (tz-re (nth 2 parse-time-iso8601-regexp)) @@ -235,10 +239,10 @@ parse-iso8601-time-string "0")) re-start (match-end 0)) (when (string-match tz-re date-string re-start) =2D (setq tz (match-string 1 date-string))) + (setq tz (* 3600 (string-to-number (match-string 1 date-string))))) (setq time (list seconds minute hour day month year day-of-week dst tz)))) =20 =2D ;; Fall back to having Gnus do fancy things for us. + ;; Fall back to having `parse-time-string' do fancy things for us. (when (not time) (setq time (parse-time-string date-string))) =20 diff --git a/src/editfns.c b/src/editfns.c index 5cc4a67ab19b..2f1f412d9e4e 100644 =2D-- a/src/editfns.c +++ b/src/editfns.c @@ -2101,9 +2101,8 @@ format_time_string (char const *format, ptrdiff_t for= matlen, =20 DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 2, 0, doc: /* Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW = DST UTCOFF). =2DThe optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED), =2Das from `current-time' and `file-attributes', or nil to use the =2Dcurrent time. +The optional TIME should be a list of (HIGH LOW . IGNORED), as from +`current-time' and `file-attributes', or nil to use the current time. It can also be a single integer number of seconds since the epoch. The obsolete form (HIGH . LOW) is also still accepted. The optional ZONE is omitted or nil for Emacs local time, t for =2D-=20 2.1.4 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYQPKwAAoJECZsfTOCL4R4OTYP+gPaQcy4cWXo9s6YN3NApF+u B5ydWV2U3SQgtT6DmqyrtyuyycrWeEf6uR1suX+nVwvk5eBGwiY4EdvzsnncSFJV lJiM3UznEBuf0Xn9p4jYzZGhj0rL19W5IeaUO2i2XAEYOO+Gc6xdtnxC2ACdEieI 7QZJ3WLjyFGuX1B1UuMiTrn8FpzpaykuiJdEg+FGfONE7a60ZmuA0QUkI+sUbT+a oIIE8PmIGl6iPlLt7LCyYdRoXZg+I+ueZlbvk5+Q0/2tpUqJinOCg1muOqL1MRn8 b8YA1llOpA4/b0XPV/4Xlo9OSfMLKzE1FKxI9Rc93EKGZ+f6WGZUno9rNzCgYvDO HMDi10+GG8wSU/aQHOj7ShIVwhL5tGc4nC17uxbvTetPu7doLmiOTeqQqaaTjQaw ANObkm+fSJD5CJhIOhrY99dZtn1hnwGTffsTFDQ6TklvVbHhlfFqsv4eoYUpjmwf i/borLKrSvN0k+ObYUbVIBN5ekWpq2bRZJc9d3O3u8aLO0q9Welbe1BV5nV64g0D QT5q4VNqsCPHwfxLHpCb9xMn8Q0rdb1OYFATOa8t7ORA2unr6eQN7ntccEEb3L2V b6WWc3GJ/jOKm+majfw8ol3heNZxV1xGxj6lxRkt5eG0yoXzxoZrK9QZHP07SJO4 MR7fHBj6Ipk7NJLWRJ0y =FWI5 -----END PGP SIGNATURE----- --==-=-=-- From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2016 06:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Matt Armstrong Cc: 25086@debbugs.gnu.org Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.14806592155817 (code B ref 25086); Fri, 02 Dec 2016 06:14:02 +0000 Received: (at 25086) by debbugs.gnu.org; 2 Dec 2016 06:13:35 +0000 Received: from localhost ([127.0.0.1]:49366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCh6F-0001Vl-6X for submit@debbugs.gnu.org; Fri, 02 Dec 2016 01:13:35 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCh6E-0001Vb-0A for 25086@debbugs.gnu.org; Fri, 02 Dec 2016 01:13:34 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1480659208879157.93331024406666; Thu, 1 Dec 2016 22:13:28 -0800 (PST) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> User-agent: mu4e 0.9.17; emacs 25.1.90.2 From: Hong Xu In-reply-to: Date: Thu, 01 Dec 2016 22:13:27 -0800 Message-ID: <87lgvyuad4.fsf@topbug.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Zoho-Virus-Status: 1 X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 2016-12-01 Thu 21:45 GMT-0800, Matt Armstrong wrote: > Hong Xu writes: > >> doc/misc/emacs-mime.texi | 3 +++ >> lisp/calendar/parse-time.el | 12 ++++++++---- >> src/editfns.c | 5 ++--- >> 3 files changed, 13 insertions(+), 7 deletions(-) > > Hi Hong, have you seen test/lisp/calendar/parse-time-tests.el? It might > be nice to add test coverage for parse-iso8601-time-string there. [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [74.201.84.163 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.201.84.163 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [74.201.84.163 listed in wl.mailspike.net] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 2016-12-01 Thu 21:45 GMT-0800, Matt Armstrong wrote: > Hong Xu writes: > >> doc/misc/emacs-mime.texi | 3 +++ >> lisp/calendar/parse-time.el | 12 ++++++++---- >> src/editfns.c | 5 ++--- >> 3 files changed, 13 insertions(+), 7 deletions(-) > > Hi Hong, have you seen test/lisp/calendar/parse-time-tests.el? It might > be nice to add test coverage for parse-iso8601-time-string there. [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [74.201.84.163 listed in wl.mailspike.net] 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [74.201.84.163 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.201.84.163 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2016-12-01 Thu 21:45 GMT-0800, Matt Armstrong wrote: > Hong Xu writes: > >> doc/misc/emacs-mime.texi | 3 +++ >> lisp/calendar/parse-time.el | 12 ++++++++---- >> src/editfns.c | 5 ++--- >> 3 files changed, 13 insertions(+), 7 deletions(-) > > Hi Hong, have you seen test/lisp/calendar/parse-time-tests.el? It might > be nice to add test coverage for parse-iso8601-time-string there. Thanks for the reminder. A patch to add tests is attached. Note that I've kept the two patches separate since the one without tests should be applied to the stable branch (since it has no test), but this patch should be applied to master. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=parse-test.patch Content-Transfer-Encoding: quoted-printable diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/pa= rse-time-tests.el index 9bcf2b4a53c7..6b2b7af0694b 100644 =2D-- a/test/lisp/calendar/parse-time-tests.el +++ b/test/lisp/calendar/parse-time-tests.el @@ -42,7 +42,15 @@ (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 +01= 00") '(42 35 19 22 2 2016 1 nil 3600))) (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 PDT= ") =2D '(42 35 19 22 2 2016 1 t -25200)))) + '(42 35 19 22 2 2016 1 t -25200))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02:00") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54+02") + '(13818 19266)))) =20 (provide 'parse-time-tests) =20 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYQREHAAoJECZsfTOCL4R44AYP/2LThICq9Yjy0SmqLR7pZm+N VZFoQDB9pnnUHuk9G7AEAVLvzw/Yiu3u2jV0ks8qNisImDJ8+fgywKQnxJeIoU/k JflJQcA9sECv6LDg4MTadtHanAJzpEAIfoaFdtEGypvbJBZ396fFwTarlNVTfr3U Nh6s+YmZy4gU2tyX8DDjlQ3SpRXDjfuRJuDHiKd/97t4qALU49PGN7X2U1fFKmbU UqwBIHYz+fZ/4mRQshY0FVm4cN3YOqAHVNVrV9NuGLRGJPqM8mSEACTaAPJmiUap LcZJE3NZRZEyeCci1jWgtge5QZ1vi/Wa+7ofxgwxhS+ck+nj3SRJcAPn9ooyRWYr t8G0RL/YZP0jYlRCiyEsJqF56RNKk49On1JozgUDuMrCCIWJa0jeqBE79+e5v8eT Mn/MiSdofr04naNbsdiAoBsZ3faweLkQKsJE/GGie8kC/0UH4q7V4M9JcgI91puk vT8a4UONOS3AdjgYzzpV2xJw3l29VLzZxRIN1aeuge7XNn9gdaSz+7q9IQnmK9R5 TQXKZYR8QnDdKPa3EvJ+xdlr51gz3XlFfrojVncIAkDTa+OOXjh1LJfwAyBCxHxG 3a0kLEHgr6/8mYKzuynRUIUvLoRf5AlPC6kdhrDN6Nl6mHgargyc6kS4tc4K7bUd MZFh8pcUon0k2x3o5zDk =6c8G -----END PGP SIGNATURE----- --==-=-=-- From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Dec 2016 00:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Matt Armstrong Cc: 25086@debbugs.gnu.org Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.148150303122036 (code B ref 25086); Mon, 12 Dec 2016 00:38:02 +0000 Received: (at 25086) by debbugs.gnu.org; 12 Dec 2016 00:37:11 +0000 Received: from localhost ([127.0.0.1]:38556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGEcB-0005jL-Kg for submit@debbugs.gnu.org; Sun, 11 Dec 2016 19:37:11 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGEc9-0005jD-PE for 25086@debbugs.gnu.org; Sun, 11 Dec 2016 19:37:10 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1481503025301270.68926416672105; Sun, 11 Dec 2016 16:37:05 -0800 (PST) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> <87lgvyuad4.fsf@topbug.net> User-agent: mu4e 0.9.18; emacs 25.1.90.9 From: Hong Xu In-reply-to: <87lgvyuad4.fsf@topbug.net> Date: Sun, 11 Dec 2016 16:37:01 -0800 Message-ID: <87vauq6l02.fsf@topbug.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Zoho-Virus-Status: 1 X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --=-=-= Content-Type: text/plain On 2016-12-01 Thu 22:13 GMT-0800, Hong Xu wrote: > On 2016-12-01 Thu 21:45 GMT-0800, Matt Armstrong wrote: > >> Hong Xu writes: >> >>> doc/misc/emacs-mime.texi | 3 +++ >>> lisp/calendar/parse-time.el | 12 ++++++++---- >>> src/editfns.c | 5 ++--- >>> 3 files changed, 13 insertions(+), 7 deletions(-) >> >> Hi Hong, have you seen test/lisp/calendar/parse-time-tests.el? It might >> be nice to add test coverage for parse-iso8601-time-string there. > > > Thanks for the reminder. A patch to add tests is attached. > > Note that I've kept the two patches separate since the one without tests > should be applied to the stable branch (since it has no test), but this > patch should be applied to master. It's been some time. Do you still consider applying this patch? Thanks. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYTfEtAAoJECZsfTOCL4R45QMP/jnFBcitGedediKnI1m7/C5n MN9QWvUEy2cZZifzghDtufQwjzzyDTQeJ5DDTt8XjukXtCAJVXLqwXoNhK7fnv7b EqIi/+pth+xuD5N/6fQegh1Enj3ggpUHYBsYq0vmy8304vWryzpZBEVm4SX7+Cky KJpBZfo+Eq2nQ9bl5g7Md+S6EwzgBKg99k3fzYHPE7JmE1I1FqZLPwzgr2YKGCot y5DO+3zQVwEJQzVr55kCgCfo25H8hv8iZ8zATuM6MiJfSnbpvQd2z/pLCWnaqWGg RFgdW+aXulfvfg89NfpOt0caNP0gXF+4OrHWS7/RwhImVxyNoqX5SGwJVJWIZuCN QyF9MKAVYFmYOiLljOYRGWefGZINA2TVxwQbYhVHylS3krz5LVikWHJhPd6Ls3QH qWMX7WPFqMvxtTAH3lUmHC4BvSHl/gxn7wPSMfw6YdR2Xm51xPx8Sls3svitpDwP AqLHmkDsMdvihzmQfBntvW+p1oOxoHpQ0iphGL+G537jViRwRacJuLl0BnFbLney 0D4nfPiKY/f+I7TVD5AvnttfbGHC9FZ5+8rZ4uzEQRc5D3ZyYgUE7N/Ou0ZMZO5Z voUZ+nBDRcw8ZCDRc8BfGV0dPcTV8m9nuiBANahVyCZ7qMR/EOwbopfht/4dHzi2 VvvFycUpM54py8hye+X5 =xpfX -----END PGP SIGNATURE----- --=-=-=-- From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Matt Armstrong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Dec 2016 17:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Hong Xu Cc: 25086@debbugs.gnu.org Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.148156338410495 (code B ref 25086); Mon, 12 Dec 2016 17:24:02 +0000 Received: (at 25086) by debbugs.gnu.org; 12 Dec 2016 17:23:04 +0000 Received: from localhost ([127.0.0.1]:39482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGUJb-0002jD-RQ for submit@debbugs.gnu.org; Mon, 12 Dec 2016 12:23:04 -0500 Received: from mail-pg0-f41.google.com ([74.125.83.41]:34598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGUJZ-0002iU-6o for 25086@debbugs.gnu.org; Mon, 12 Dec 2016 12:23:01 -0500 Received: by mail-pg0-f41.google.com with SMTP id x23so37381865pgx.1 for <25086@debbugs.gnu.org>; Mon, 12 Dec 2016 09:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Zyt3dgNdHQSdPtBsoKGCLDFvp8zE7BTOEkYvPlGcBSg=; b=E9ZJBHpQvAZMiQeUQ96qO0AMitQ3laXEoLG+4tR8AOSmCZ5T0uAJSJD60WrILGCcK3 X4TetIHSeeWQwzYRpp/SU8G2tohAwzYaC8cV+RUhF/Sb6LU6eymUDXRXM4R9GuyGCvnJ jJbU5Z+HxRCVIMDgkg0YqIp1CqqyB1mb3Hwy5vJP22IokasuzLOTS5ZXsg6zFB+SMpnD M99T4cb8OdAtQhI6ZvxUONzmHl4fogYCn58yeYOvmoE3MuWY9E8VHpE4Sf8pOmqnJEjc 5yGlSb4DcVhNL9W91yEZiCvKwckrgt4oQU+L3ACAZXhY/AJ5o3oTtgoxbAhphdBV/zZO vN7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Zyt3dgNdHQSdPtBsoKGCLDFvp8zE7BTOEkYvPlGcBSg=; b=DWPlEOLsgV20AR0a4DSEXmyIdANf0Okua3n1lwRSMAA1ty2b/sRVZE6z3f7Vopox6m O7jbzudQ5Kh1TiLBUNbGLXek2MyCG1FX6NSlHVUhXuz46KkQ0O2NAxZeoc+PGyZm1/sc AczW1Z5X8MBu7tBBmQujyNdZo4h19adNt+EkjhceS44n4jSE6Ps7EFfyALiNX2qPnYOm s0tNbFePOGV4mX+krKpvg5np5rrYxVwsMI7skqW7IJucRIJMPUZz3ORT4iQBtOxao3d/ /1DLP/6r6MKldOekKbGnPnCpT2cg7StxMv0PI8KoGnFYbLdo8Mkv0YXb8SjStoFDKQik tpqA== X-Gm-Message-State: AKaTC029RGME7x/9bHlHYe9uYc3pqX2Y5XWkovUWeNOt1t2BJpTzF+Lp/36NORLdCy0b0APj X-Received: by 10.99.6.134 with SMTP id 128mr167343414pgg.53.1481563375001; Mon, 12 Dec 2016 09:22:55 -0800 (PST) Received: from marmstrong-linux.kir.corp.google.com ([2620:0:1008:11:cde8:9267:f157:4b36]) by smtp.gmail.com with ESMTPSA id f132sm76997099pfa.72.2016.12.12.09.22.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2016 09:22:54 -0800 (PST) From: Matt Armstrong In-Reply-To: <87vauq6l02.fsf@topbug.net> References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> <87lgvyuad4.fsf@topbug.net> <87vauq6l02.fsf@topbug.net> Date: Mon, 12 Dec 2016 09:22:53 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.1 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.1 (---) Hong Xu writes: > It's been some time. Do you still consider applying this patch? Hi Hong, just so you know, I do not have commit access so I cannot apply a patch myself. A similar bug I filed took a month or two before a volunteer applied the patch. Perhaps emailing emacs-devel would generate some interest. From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Dec 2016 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Matt Armstrong Cc: 25086@debbugs.gnu.org, hong@topbug.net Reply-To: Eli Zaretskii Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.148156549513582 (code B ref 25086); Mon, 12 Dec 2016 17:59:02 +0000 Received: (at 25086) by debbugs.gnu.org; 12 Dec 2016 17:58:15 +0000 Received: from localhost ([127.0.0.1]:39501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGUrf-0003X0-0n for submit@debbugs.gnu.org; Mon, 12 Dec 2016 12:58:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGUrd-0003Wk-7e for 25086@debbugs.gnu.org; Mon, 12 Dec 2016 12:58:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGUrT-0002qd-VF for 25086@debbugs.gnu.org; Mon, 12 Dec 2016 12:58:07 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGUrT-0002qW-Su; Mon, 12 Dec 2016 12:58:03 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4777 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cGUrT-0000l1-5W; Mon, 12 Dec 2016 12:58:03 -0500 Date: Mon, 12 Dec 2016 19:58:41 +0200 Message-Id: <8337htc9m6.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Matt Armstrong on Mon, 12 Dec 2016 09:22:53 -0800) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> <87lgvyuad4.fsf@topbug.net> <87vauq6l02.fsf@topbug.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > From: Matt Armstrong > Date: Mon, 12 Dec 2016 09:22:53 -0800 > Cc: 25086@debbugs.gnu.org > > Hong Xu writes: > > > It's been some time. Do you still consider applying this patch? > > Hi Hong, just so you know, I do not have commit access so I cannot apply > a patch myself. A similar bug I filed took a month or two before a > volunteer applied the patch. Perhaps emailing emacs-devel would > generate some interest. It's on my list, if no one beats me to it. From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Dec 2016 14:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Hong Xu Cc: 25086@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.148198673727066 (code B ref 25086); Sat, 17 Dec 2016 14:59:01 +0000 Received: (at 25086) by debbugs.gnu.org; 17 Dec 2016 14:58:57 +0000 Received: from localhost ([127.0.0.1]:45105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cIGRs-00072U-Us for submit@debbugs.gnu.org; Sat, 17 Dec 2016 09:58:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50291) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cIGRq-00072G-SC for 25086@debbugs.gnu.org; Sat, 17 Dec 2016 09:58:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cIGRg-0004nn-QL for 25086@debbugs.gnu.org; Sat, 17 Dec 2016 09:58:49 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cIGRg-0004nj-NW; Sat, 17 Dec 2016 09:58:44 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3727 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cIGRf-0003dW-Sr; Sat, 17 Dec 2016 09:58:44 -0500 Date: Sat, 17 Dec 2016 16:58:06 +0200 Message-Id: <837f6y7gch.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <8737i7yo27.fsf@topbug.net> (message from Hong Xu on Thu, 01 Dec 2016 20:04:00 -0800) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > From: Hong Xu > Date: Thu, 01 Dec 2016 20:04:00 -0800 > > +;;;###autoload > (defun parse-iso8601-time-string (date-string) > + "Parse an ISO 8601 time string, such as 2016-12-01T23:35:06-05:00. > +If DATE-STRING cannot be parsed, it falls back to > +`parse-time-string'." Why did you want to autoload this? The log message doesn't mention this change at all. > + '(42 35 19 22 2 2016 1 t -25200))) > + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200") > + '(13818 33666))) > + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02:00") > + '(13818 33666))) > + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02") > + '(13818 33666))) > + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54+02") > + '(13818 19266)))) Does this also test this part of your changes: > @@ -204,13 +204,17 @@ parse-time-iso8601-regexp > (date-time (concat full-date "T" full-time))) > (list (concat "^" full-date) > (concat "T" partial-time) > - (concat "Z" time-numoffset))) > + (concat "Z?" time-numoffset))) If not, could you please add tests for that? Thanks. From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Dec 2016 20:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 25086@debbugs.gnu.org Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.148200739025932 (code B ref 25086); Sat, 17 Dec 2016 20:44:01 +0000 Received: (at 25086) by debbugs.gnu.org; 17 Dec 2016 20:43:10 +0000 Received: from localhost ([127.0.0.1]:45212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cILoz-0006kB-Ik for submit@debbugs.gnu.org; Sat, 17 Dec 2016 15:43:09 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cILox-0006k3-Un for 25086@debbugs.gnu.org; Sat, 17 Dec 2016 15:43:08 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1482007381310407.7253015250884; Sat, 17 Dec 2016 12:43:01 -0800 (PST) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> <837f6y7gch.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.1.90.6 From: Hong Xu In-reply-to: <837f6y7gch.fsf@gnu.org> Date: Sat, 17 Dec 2016 12:42:57 -0800 Message-ID: <87eg16z3qm.fsf@topbug.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Zoho-Virus-Status: 1 X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2016-12-17 Sat 06:58 GMT-0800, Eli Zaretskii wrote: >> From: Hong Xu >> Date: Thu, 01 Dec 2016 20:04:00 -0800 >> >> +;;;###autoload >> (defun parse-iso8601-time-string (date-string) >> + "Parse an ISO 8601 time string, such as 2016-12-01T23:35:06-05:00. >> +If DATE-STRING cannot be parsed, it falls back to >> +`parse-time-string'." > > Why did you want to autoload this? The log message doesn't mention > this change at all. The attached new version now fixes this issue in the log message. It autoloads because parse-time-string autoloads -- If parse-time-string is useful for autoloading, there is no reason that parse-iso8601-time-string is not useful for that. > >> + '(42 35 19 22 2 2016 1 t -25200))) >> + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200") >> + '(13818 33666))) >> + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02:00") >> + '(13818 33666))) >> + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02") >> + '(13818 33666))) >> + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54+02") >> + '(13818 19266)))) > > Does this also test this part of your changes: > >> @@ -204,13 +204,17 @@ parse-time-iso8601-regexp >> (date-time (concat full-date "T" full-time))) >> (list (concat "^" full-date) >> (concat "T" partial-time) >> - (concat "Z" time-numoffset))) >> + (concat "Z?" time-numoffset))) > > If not, could you please add tests for that? > I've added the tests now. And indeed, it exposes a bug in the original patch. Again, I decomposed the patch to two different parts, one for the stable branch and the other (with only test files) for the master branch. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-the-timezone-detection-of-parse-iso8601-time-str.patch Content-Transfer-Encoding: quoted-printable From=2039e4d94da9b8806871cb2c9145cd1f14233526f5 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 17 Dec 2016 12:07:45 -0800 Subject: [PATCH] Fix the timezone detection of parse-iso8601-time-string. * parse-time.el (parse-iso8601-time-string): Fix its timezone parsing and make it autoload. * parse-time.el: Add doc for parse-iso8601-time-string and make it autoload. * editfns.c (Fdecode-time): Minor doc improvement for decode-time. * emacs-mime.texi (time-date): Add an example for parse-iso8601-time-string. =2D-- doc/misc/emacs-mime.texi | 3 +++ lisp/calendar/parse-time.el | 19 ++++++++++++------- src/editfns.c | 5 ++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 4d68246bba4b..8d6536265416 100644 =2D-- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -1536,6 +1536,9 @@ time-date (date-to-time "Sat Sep 12 12:21:54 1998 +0200") @result{} (13818 19266) =20 +(parse-iso8601-time-string "1998-09-12T12:21:54+0200") +@result{} (13818 19266) + (float-time '(13818 19266)) @result{} 905595714.0 =20 diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 6ba26a4a00d0..6bd748cbe0d9 100644 =2D-- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -195,7 +195,7 @@ parse-time-iso8601-regexp (time-minute 2digit) (time-second 2digit) (time-secfrac "\\(\\.[0-9]+\\)?") =2D (time-numoffset (concat "[-+]\\(" time-hour "\\):" time-minute)) + (time-numoffset (concat "\\([-+]" time-hour "\\):?" time-minute "?")) (time-offset (concat "Z" time-numoffset)) (partial-time (concat time-hour colon time-minute colon time-second time-secfrac)) @@ -204,19 +204,24 @@ parse-time-iso8601-regexp (date-time (concat full-date "T" full-time))) (list (concat "^" full-date) (concat "T" partial-time) =2D (concat "Z" time-numoffset))) + (concat "Z?" time-numoffset))) "List of regular expressions matching ISO 8601 dates. 1st regular expression matches the date. 2nd regular expression matches the time. 3rd regular expression matches the (optional) timezone specification.") =20 +;;;###autoload (defun parse-iso8601-time-string (date-string) + "Parse an ISO 8601 time string, such as 2016-12-01T23:35:06-05:00. +If DATE-STRING cannot be parsed, it falls back to +`parse-time-string'." (let* ((date-re (nth 0 parse-time-iso8601-regexp)) (time-re (nth 1 parse-time-iso8601-regexp)) (tz-re (nth 2 parse-time-iso8601-regexp)) =2D re-start =2D time seconds minute hour fractional-seconds =2D day month year day-of-week dst tz) + (tz 0) + re-start + time seconds minute hour fractional-seconds + day month year day-of-week dst) ;; We need to populate 'time' with ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ) =20 @@ -235,10 +240,10 @@ parse-iso8601-time-string "0")) re-start (match-end 0)) (when (string-match tz-re date-string re-start) =2D (setq tz (match-string 1 date-string))) + (setq tz (* 3600 (string-to-number (match-string 1 date-string))= ))) (setq time (list seconds minute hour day month year day-of-week dst tz)))) =20 =2D ;; Fall back to having Gnus do fancy things for us. + ;; Fall back to having `parse-time-string' do fancy things for us. (when (not time) (setq time (parse-time-string date-string))) =20 diff --git a/src/editfns.c b/src/editfns.c index 5cc4a67ab19b..2f1f412d9e4e 100644 =2D-- a/src/editfns.c +++ b/src/editfns.c @@ -2101,9 +2101,8 @@ format_time_string (char const *format, ptrdiff_t for= matlen, =20 DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 2, 0, doc: /* Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW = DST UTCOFF). =2DThe optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED), =2Das from `current-time' and `file-attributes', or nil to use the =2Dcurrent time. +The optional TIME should be a list of (HIGH LOW . IGNORED), as from +`current-time' and `file-attributes', or nil to use the current time. It can also be a single integer number of seconds since the epoch. The obsolete form (HIGH . LOW) is also still accepted. The optional ZONE is omitted or nil for Emacs local time, t for =2D-=20 2.1.4 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-tests-for-parse-iso8601-time-string.patch Content-Transfer-Encoding: quoted-printable From=209f06f66c4d5970c4cf692956544456ab4458f3b1 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 17 Dec 2016 12:38:26 -0800 Subject: [PATCH] Add tests for parse-iso8601-time-string. * parse-time-tests.el (parse-time-tests): Add tests for parse-iso8601-time-string. =2D-- test/lisp/calendar/parse-time-tests.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/pa= rse-time-tests.el index 9bcf2b4a53c7..7a087d0f0bee 100644 =2D-- a/test/lisp/calendar/parse-time-tests.el +++ b/test/lisp/calendar/parse-time-tests.el @@ -42,7 +42,19 @@ (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 +01= 00") '(42 35 19 22 2 2016 1 nil 3600))) (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 PDT= ") =2D '(42 35 19 22 2 2016 1 t -25200)))) + '(42 35 19 22 2 2016 1 t -25200))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02:00") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54+02") + '(13818 19266))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54Z") + '(13818 26466))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54") + '(13818 26466)))) =20 (provide 'parse-time-tests) =20 =2D-=20 2.1.4 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYVaNRAAoJECZsfTOCL4R4uy4P/iM+/EZExBNGLYRuUm2BN+o7 ZqEsCP51tbz4elGydZB0H1TH8j2C4b1fnw62VMWuTupD/qmZRF3oS5ZQnL64TiQT tt3poIEpBxSFOQsWmHWSUg3EpgDmXbA6zDLanE+eUhTTszbyuAzEQacHh3jEeB2P /C20/QvznDSDu2qC9Cq3U8iA3SLl+jIgtH29ktaLyXJsp+0RtmmEkVRZXY9UsTvX Lad/g8hhoWv5Ud7fMRGdsT8FXYPay/R2aftdcu5upEKK1WkAW6kfhymVBU16RWd4 Bj94eCgkBjTJ/jMklCUydnw2MfWM5E9Aryy7iLoJpK88lBwFR234RSdKDHFLec7c WSfSwz2JRVhcXnUV2ge+ADgTNWt2/FEqPWK8ATYz9Iy4njOtJTaiurEoYOVUQawH LBMYM/o2i0uxpdyFdMwF6bBB1rmTew+iZn8+4iYWp60zBgq8yQr1ws4RiOjhgoNS VM+U5SoGBzMEpWCJAqlOF59qUwkmgY1aQU8jKf+l1xE25v+IC7lwvJq4vFuKu6zL 3kSLHHZNIuHkuiVl2/mwtKHsEyTIppI8/nBjyO+aID8rv4Os9Cm5eEN7Lnq6/kXA aYNjsvtc1A081bDI+7EDXDq9YVAIo08epvp/Yp8eQNHsoxfzdVeENhQ8PxZko7AJ tU9Bi/1FatVMyWQufQJk =ZnOk -----END PGP SIGNATURE----- --==-=-=-- From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Dec 2016 03:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 25086@debbugs.gnu.org Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.14820307309209 (code B ref 25086); Sun, 18 Dec 2016 03:13:01 +0000 Received: (at 25086) by debbugs.gnu.org; 18 Dec 2016 03:12:10 +0000 Received: from localhost ([127.0.0.1]:45327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cIRtS-0002OT-7r for submit@debbugs.gnu.org; Sat, 17 Dec 2016 22:12:10 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cIRtQ-0002OK-Fa for 25086@debbugs.gnu.org; Sat, 17 Dec 2016 22:12:09 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1482030723102152.26069087372434; Sat, 17 Dec 2016 19:12:03 -0800 (PST) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> <837f6y7gch.fsf@gnu.org> <87eg16z3qm.fsf@topbug.net> User-agent: mu4e 0.9.18; emacs 25.1.90.7 From: Hong Xu In-reply-to: <87eg16z3qm.fsf@topbug.net> Date: Sat, 17 Dec 2016 19:11:58 -0800 Message-ID: <87d1gqlym9.fsf@topbug.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Zoho-Virus-Status: 1 X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2016-12-17 Sat 12:42 GMT-0800, Hong Xu wrote: > > I've added the tests now. And indeed, it exposes a bug in the original patch. > > Again, I decomposed the patch to two different parts, one for the stable > branch and the other (with only test files) for the master branch. > Attached is a newer version which has fixed a few edge cases. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-the-timezone-detection-of-parse-iso8601-time-str.patch Content-Transfer-Encoding: quoted-printable From=20a7050f2785a74c6669dae556fa9a1deae84081a8 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 17 Dec 2016 12:07:45 -0800 Subject: [PATCH] Fix the timezone detection of parse-iso8601-time-string. * parse-time.el (parse-iso8601-time-string): Fix its timezone parsing and make it autoload. * parse-time.el: Add doc for parse-iso8601-time-string. * editfns.c (Fdecode-time): Minor doc improvement for decode-time. * emacs-mime.texi (time-date): Add an example for parse-iso8601-time-string. =2D-- doc/misc/emacs-mime.texi | 3 +++ lisp/calendar/parse-time.el | 27 ++++++++++++++++++++------- src/editfns.c | 5 ++--- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 4d68246bba4b..8d6536265416 100644 =2D-- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -1536,6 +1536,9 @@ time-date (date-to-time "Sat Sep 12 12:21:54 1998 +0200") @result{} (13818 19266) =20 +(parse-iso8601-time-string "1998-09-12T12:21:54+0200") +@result{} (13818 19266) + (float-time '(13818 19266)) @result{} 905595714.0 =20 diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 6ba26a4a00d0..be1107ee3d29 100644 =2D-- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -195,7 +195,7 @@ parse-time-iso8601-regexp (time-minute 2digit) (time-second 2digit) (time-secfrac "\\(\\.[0-9]+\\)?") =2D (time-numoffset (concat "[-+]\\(" time-hour "\\):" time-minute)) + (time-numoffset (concat "\\([-+]\\)" time-hour ":?" time-minute "?")) (time-offset (concat "Z" time-numoffset)) (partial-time (concat time-hour colon time-minute colon time-second time-secfrac)) @@ -204,19 +204,23 @@ parse-time-iso8601-regexp (date-time (concat full-date "T" full-time))) (list (concat "^" full-date) (concat "T" partial-time) =2D (concat "Z" time-numoffset))) + (concat "\\(Z\\|" time-numoffset "\\)"))) "List of regular expressions matching ISO 8601 dates. 1st regular expression matches the date. 2nd regular expression matches the time. 3rd regular expression matches the (optional) timezone specification.") =20 +;;;###autoload (defun parse-iso8601-time-string (date-string) + "Parse an ISO 8601 time string, such as 2016-12-01T23:35:06-05:00. +If DATE-STRING cannot be parsed, it falls back to +`parse-time-string'." (let* ((date-re (nth 0 parse-time-iso8601-regexp)) (time-re (nth 1 parse-time-iso8601-regexp)) (tz-re (nth 2 parse-time-iso8601-regexp)) =2D re-start =2D time seconds minute hour fractional-seconds =2D day month year day-of-week dst tz) + re-start + time seconds minute hour fractional-seconds + day month year day-of-week dst tz) ;; We need to populate 'time' with ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ) =20 @@ -235,10 +239,19 @@ parse-iso8601-time-string "0")) re-start (match-end 0)) (when (string-match tz-re date-string re-start) =2D (setq tz (match-string 1 date-string))) + (if (string=3D "Z" (match-string 1 date-string)) + (setq tz 0) ;; UTC timezone indicated by Z + (setq tz (+ + (* 3600 + (string-to-number (match-string 3 date-string))) + (* 60 + (string-to-number + (or (match-string 4 date-string) "0"))))) + (when (string=3D "-" (match-string 2 date-string)) + (setq tz (- tz))))) (setq time (list seconds minute hour day month year day-of-week dst tz)))) =20 =2D ;; Fall back to having Gnus do fancy things for us. + ;; Fall back to having `parse-time-string' do fancy things for us. (when (not time) (setq time (parse-time-string date-string))) =20 diff --git a/src/editfns.c b/src/editfns.c index 5cc4a67ab19b..2f1f412d9e4e 100644 =2D-- a/src/editfns.c +++ b/src/editfns.c @@ -2101,9 +2101,8 @@ format_time_string (char const *format, ptrdiff_t for= matlen, =20 DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 2, 0, doc: /* Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW = DST UTCOFF). =2DThe optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED), =2Das from `current-time' and `file-attributes', or nil to use the =2Dcurrent time. +The optional TIME should be a list of (HIGH LOW . IGNORED), as from +`current-time' and `file-attributes', or nil to use the current time. It can also be a single integer number of seconds since the epoch. The obsolete form (HIGH . LOW) is also still accepted. The optional ZONE is omitted or nil for Emacs local time, t for =2D-=20 2.1.4 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-tests-for-parse-iso8601-time-string.patch Content-Transfer-Encoding: quoted-printable From=20f53bed4fa277af83c5194854c092687a1002d709 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 17 Dec 2016 12:38:26 -0800 Subject: [PATCH] Add tests for parse-iso8601-time-string. * parse-time-tests.el (parse-time-tests): Add tests for parse-iso8601-time-string. =2D-- test/lisp/calendar/parse-time-tests.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/pa= rse-time-tests.el index 9bcf2b4a53c7..6dc23372f249 100644 =2D-- a/test/lisp/calendar/parse-time-tests.el +++ b/test/lisp/calendar/parse-time-tests.el @@ -42,7 +42,23 @@ (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 +01= 00") '(42 35 19 22 2 2016 1 nil 3600))) (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 PDT= ") =2D '(42 35 19 22 2 2016 1 t -25200)))) + '(42 35 19 22 2 2016 1 t -25200))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0230") + '(13818 35466))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02:00") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54+0230") + '(13818 17466))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54+02") + '(13818 19266))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54Z") + '(13818 26466))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54") + (encode-time 54 21 12 12 9 1998)))) =20 (provide 'parse-time-tests) =20 =2D-=20 2.1.4 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYVf5+AAoJECZsfTOCL4R4HF0P/1K/LSe5ztoT8MaOeONaauPj r5l9lqTrU3Ouou/5JBXmp9HB+GN8nQgUaDPJDoPm5oso/beZKll1zwolN8vY1Eog QXOuM2dOVR4TAF4V+SAP2+H1UmUZwqUF0rpQHqCA0sdCU3YRZKAkPCj8UqjJVyJC 8fxbs+2UDA576fhmMGbKTOwbONxqzuIqhDhmHrv3OMkTkkWm2JhfncchuJ8aZhw0 +ZBGX7wYb8MBwxHwejJ+Bep3JR/tKa/pq7k3nnH9BTPobKT+d7ptUpktVfPcmaNb YeDju2nhOp6DYdBMfpukr4HQfkbrNhsHkYA3P7dgrAJ0N51TVYvEuedS90+H1A6d dNucQfUkfXB1t/nZQv8mshaWWILqZHO2KvP/NZi/DulLNiScILzFRh8/gWgQ8+w/ MIbnp+EShVAwtP8VWwXdh1KNnpIBzc/eTi2A3J0DkPmHQ2cjTAMucC/JKiFmnnhy 20eue1NtXN3SCkfHEEkBtC2QbvQHXA5RQyMpFZnJErJ1z5uBhH1xhTM81xG7TJ4F a1KT53+2U5ECpnmdShadnP3gTyQxigXuUh1Mtk8cbEMtWdLv6gvcrKRLgYjBNVAK VzhiDOhpXSTshYLez/2A6DZ73MlQltUgqe8I0q/smRpKtx7cypFjdNjvYeepYcEO K/o+l/9LizqWy4qx6Uap =+4DV -----END PGP SIGNATURE----- --==-=-=-- From unknown Sun Aug 10 02:41:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Hong Xu Subject: bug#25086: closed (Re: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string.) Message-ID: References: <834m1tzehm.fsf@gnu.org> <1480650408-26252-1-git-send-email-hong@topbug.net> X-Gnu-PR-Message: they-closed 25086 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 25086@debbugs.gnu.org Date: Sat, 24 Dec 2016 12:42:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1482583322-10432-1" This is a multi-part message in MIME format... ------------=_1482583322-10432-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25086@debbugs.gnu.org. --=20 25086: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25086 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1482583322-10432-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 25086-done) by debbugs.gnu.org; 24 Dec 2016 12:41:39 +0000 Received: from localhost ([127.0.0.1]:53291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKldr-0002hd-8E for submit@debbugs.gnu.org; Sat, 24 Dec 2016 07:41:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKldp-0002hR-P4 for 25086-done@debbugs.gnu.org; Sat, 24 Dec 2016 07:41:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKldg-0007Gv-L8 for 25086-done@debbugs.gnu.org; Sat, 24 Dec 2016 07:41:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKldg-0007Gj-Ht; Sat, 24 Dec 2016 07:41:28 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3742 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cKldf-00060D-Si; Sat, 24 Dec 2016 07:41:28 -0500 Date: Sat, 24 Dec 2016 14:41:09 +0200 Message-Id: <834m1tzehm.fsf@gnu.org> From: Eli Zaretskii To: Hong Xu In-reply-to: <87d1gqlym9.fsf@topbug.net> (message from Hong Xu on Sat, 17 Dec 2016 19:11:58 -0800) Subject: Re: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> <837f6y7gch.fsf@gnu.org> <87eg16z3qm.fsf@topbug.net> <87d1gqlym9.fsf@topbug.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: 25086-done Cc: 25086-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > From: Hong Xu > Cc: 25086@debbugs.gnu.org > Date: Sat, 17 Dec 2016 19:11:58 -0800 > > On 2016-12-17 Sat 12:42 GMT-0800, Hong Xu wrote: > > > > I've added the tests now. And indeed, it exposes a bug in the original patch. > > > > Again, I decomposed the patch to two different parts, one for the stable > > branch and the other (with only test files) for the master branch. > > Attached is a newer version which has fixed a few edge cases. Thanks, pushed to master. I didn't make parse-iso8601-time-string autoloaded. I don't think it's needed; if you think it is, please tell why. Also, a minor not about log messages: > * parse-time.el (parse-iso8601-time-string): Fix its timezone > parsing and make it autoload. > * parse-time.el: Add doc for parse-iso8601-time-string. These are changes in the same function and the same source file. So they should be written together, like this: * parse-time.el (parse-iso8601-time-string): Fix timezone parsing. Add a doc string. Thank you for your contribution and for your patience. ------------=_1482583322-10432-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Dec 2016 03:47:06 +0000 Received: from localhost ([127.0.0.1]:49304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCeoU-0006Tn-0R for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:47:06 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCeoS-0006TJ-Hc for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:47:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCeoM-0006gc-9U for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:46:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCeoM-0006gF-6f for submit@debbugs.gnu.org; Thu, 01 Dec 2016 22:46:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCeoK-0001nx-TD for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:46:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCeoH-0006bN-OY for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:46:56 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21459) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCeoH-0006aw-Eu for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 22:46:53 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1480650408710973.6395530284094; Thu, 1 Dec 2016 19:46:48 -0800 (PST) From: Hong Xu To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Date: Thu, 1 Dec 2016 19:46:48 -0800 Message-Id: <1480650408-26252-1-git-send-email-hong@topbug.net> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) * parse-time.el (parse-iso8601-time-string): Fix its timezone parsing. * parse-time.el: Add doc for parse-iso8601-time-string and make it autoload. * editfns.c (Fdecode-time): Minor doc improvement for decode-time. --- doc/misc/emacs-mime.texi | 3 +++ lisp/calendar/parse-time.el | 12 ++++++++---- src/editfns.c | 5 ++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 4d68246bba4b..8d6536265416 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -1536,6 +1536,9 @@ time-date (date-to-time "Sat Sep 12 12:21:54 1998 +0200") @result{} (13818 19266) +(parse-iso8601-time-string "1998-09-12T12:21:54+0200") +@result{} (13818 19266) + (float-time '(13818 19266)) @result{} 905595714.0 diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 6ba26a4a00d0..bc1efbb074e3 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -195,7 +195,7 @@ parse-time-iso8601-regexp (time-minute 2digit) (time-second 2digit) (time-secfrac "\\(\\.[0-9]+\\)?") - (time-numoffset (concat "[-+]\\(" time-hour "\\):" time-minute)) + (time-numoffset (concat "\\([-+]" time-hour "\\):?" time-minute)) (time-offset (concat "Z" time-numoffset)) (partial-time (concat time-hour colon time-minute colon time-second time-secfrac)) @@ -204,13 +204,17 @@ parse-time-iso8601-regexp (date-time (concat full-date "T" full-time))) (list (concat "^" full-date) (concat "T" partial-time) - (concat "Z" time-numoffset))) + (concat "Z?" time-numoffset))) "List of regular expressions matching ISO 8601 dates. 1st regular expression matches the date. 2nd regular expression matches the time. 3rd regular expression matches the (optional) timezone specification.") +;;;###autoload (defun parse-iso8601-time-string (date-string) + "Parse an ISO 8601 time string, such as 2016-12-01T23:35:06-05:00. +If DATE-STRING cannot be parsed, it falls back to +`parse-time-string'." (let* ((date-re (nth 0 parse-time-iso8601-regexp)) (time-re (nth 1 parse-time-iso8601-regexp)) (tz-re (nth 2 parse-time-iso8601-regexp)) @@ -235,10 +239,10 @@ parse-iso8601-time-string "0")) re-start (match-end 0)) (when (string-match tz-re date-string re-start) - (setq tz (match-string 1 date-string))) + (setq tz (* 3600 (string-to-number (match-string 1 date-string))))) (setq time (list seconds minute hour day month year day-of-week dst tz)))) - ;; Fall back to having Gnus do fancy things for us. + ;; Fall back to having `parse-time-string' do fancy things for us. (when (not time) (setq time (parse-time-string date-string))) diff --git a/src/editfns.c b/src/editfns.c index 5cc4a67ab19b..2f1f412d9e4e 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2101,9 +2101,8 @@ format_time_string (char const *format, ptrdiff_t formatlen, DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 2, 0, doc: /* Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW DST UTCOFF). -The optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED), -as from `current-time' and `file-attributes', or nil to use the -current time. +The optional TIME should be a list of (HIGH LOW . IGNORED), as from +`current-time' and `file-attributes', or nil to use the current time. It can also be a single integer number of seconds since the epoch. The obsolete form (HIGH . LOW) is also still accepted. The optional ZONE is omitted or nil for Emacs local time, t for -- 2.1.4 ------------=_1482583322-10432-1-- From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2016 21:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 25086-done@debbugs.gnu.org Received: via spool by 25086-done@debbugs.gnu.org id=D25086.148261345832386 (code D ref 25086); Sat, 24 Dec 2016 21:05:02 +0000 Received: (at 25086-done) by debbugs.gnu.org; 24 Dec 2016 21:04:18 +0000 Received: from localhost ([127.0.0.1]:54081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKtUI-0008QH-8L for submit@debbugs.gnu.org; Sat, 24 Dec 2016 16:04:18 -0500 Received: from sender-of-o52.zoho.com ([135.84.80.217]:21323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKtUG-0008Q9-I9 for 25086-done@debbugs.gnu.org; Sat, 24 Dec 2016 16:04:17 -0500 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 148261345067628.70905552989268; Sat, 24 Dec 2016 13:04:10 -0800 (PST) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> <837f6y7gch.fsf@gnu.org> <87eg16z3qm.fsf@topbug.net> <87d1gqlym9.fsf@topbug.net> <834m1tzehm.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.1.90.12 From: Hong Xu In-reply-to: <834m1tzehm.fsf@gnu.org> Date: Sat, 24 Dec 2016 13:04:05 -0800 Message-ID: <877f6pavju.fsf@topbug.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Zoho-Virus-Status: 1 X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --=-=-= Content-Type: text/plain On 2016-12-24 Sat 04:41 GMT-0800, Eli Zaretskii wrote: >> From: Hong Xu >> Cc: 25086@debbugs.gnu.org >> Date: Sat, 17 Dec 2016 19:11:58 -0800 >> >> On 2016-12-17 Sat 12:42 GMT-0800, Hong Xu wrote: >> > >> > I've added the tests now. And indeed, it exposes a bug in the original patch. >> > >> > Again, I decomposed the patch to two different parts, one for the stable >> > branch and the other (with only test files) for the master branch. >> >> Attached is a newer version which has fixed a few edge cases. > > Thanks, pushed to master. > Thank you. Could you backport it to the stable branch? It is indeed a bug fix in my point of view -- no new feature is added. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYXuLFAAoJECZsfTOCL4R4iXIP/RB31aL3LhnAfqpKKPhK6t9P UiINBvHTPyoCT8mrokshPEURWPcHlOabGKq8Rb5j1YupFfKMOx87dN6sM0mDXHnn NHLSw8XhTSyEzdy+P82R3ngn4AzHdUQ0hNJLTI3kbadYh+8xcLABssuWg/4vmp12 oLPwt7InYcmLupvF05ecbgrLTG2UpQR7K7Gn8PZTms6vlBQyG+gYI2MsRfZ62g2o UWd6py8A7Ii8OIVdSV23vVqrggEJ3xaR9xXoQCx+Bzy90QY4I4LPrz+FrvZkgxc6 Yl5oT3G3HJ+lkjF6zI94FMPetgvmwBEFt8oM0lCwv2yEPUvz0ZX/pxXfwMyRfzXi XZQjr1ldijwDkW2RMZScxgYUVar18wZ9c8ZFhgl8PzKOGHquZLCMqaw+yyP6dVz2 rEE4vhVAHZVy0YiNqOa5lpzLkjuBa7TKLR37yGPO2ZgIJdZf9itO+2geltfLUbjB JUk9V+bZMydqdTyJ+DimeLkTxdttAgxIwCJ11UoX5AVusljHyQHB6fnMaE7taNBB gJbdw6J4/gCJLJ4LXMptnlg6tTGi6uQrPx4YapRLE/6YQa24obRoCX71p//sAtcV pxrlPBP9iUKkn3IVEagyuIDJ0m9+NgSOob0ZLP9JcM22go3ip9VE6lAFxGdw0+eC vrC1Ux3/cEgK5err+GTK =BAqE -----END PGP SIGNATURE----- --=-=-=-- From unknown Sun Aug 10 02:41:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2016 03:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Hong Xu Cc: 25086@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.14826365745278 (code B ref 25086); Sun, 25 Dec 2016 03:30:02 +0000 Received: (at 25086) by debbugs.gnu.org; 25 Dec 2016 03:29:34 +0000 Received: from localhost ([127.0.0.1]:54199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKzV7-0001N4-NJ for submit@debbugs.gnu.org; Sat, 24 Dec 2016 22:29:33 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKzV4-0001Mo-A3 for 25086@debbugs.gnu.org; Sat, 24 Dec 2016 22:29:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKzUv-0005iX-Sx for 25086@debbugs.gnu.org; Sat, 24 Dec 2016 22:29:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKzUv-0005iR-PG; Sat, 24 Dec 2016 22:29:21 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4815 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cKzUv-0004vn-3l; Sat, 24 Dec 2016 22:29:21 -0500 Date: Sun, 25 Dec 2016 05:29:04 +0200 Message-Id: <83k2aoy9dr.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <877f6pavju.fsf@topbug.net> (message from Hong Xu on Sat, 24 Dec 2016 13:04:05 -0800) References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> <837f6y7gch.fsf@gnu.org> <87eg16z3qm.fsf@topbug.net> <87d1gqlym9.fsf@topbug.net> <834m1tzehm.fsf@gnu.org> <877f6pavju.fsf@topbug.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > From: Hong Xu > Cc: 25086-done@debbugs.gnu.org > Date: Sat, 24 Dec 2016 13:04:05 -0800 > > > Thanks, pushed to master. > > > > Thank you. Could you backport it to the stable branch? It is indeed a > bug fix in my point of view -- no new feature is added. Sorry, it's too late for the release branch. It only gets bugfixes for issues introduced by the last two releases of Emacs, and this one wasn't, AFAIU.