From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Bastien Newsgroups: gmane.emacs.devel Subject: [PATCH] Fix for `parse-time-string' Date: Fri, 24 Jan 2020 11:06:19 +0100 Organization: GNU Message-ID: <87iml1yxr8.fsf@bzg.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74955"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Paul Eggert To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 24 11:09:38 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iuvuE-000JSO-0Y for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Jan 2020 11:09:38 +0100 Original-Received: from localhost ([::1]:39824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuvuD-0001VE-1o for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Jan 2020 05:09:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuvrF-0005o5-OI for emacs-devel@gnu.org; Fri, 24 Jan 2020 05:06:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iuvrF-0002L8-Jg; Fri, 24 Jan 2020 05:06:33 -0500 Original-Received: from 108.120.15.109.rev.sfr.net ([109.15.120.108]:39722 helo=guerry) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1iuvrA-0000Ty-Du; Fri, 24 Jan 2020 05:06:32 -0500 Original-Received: by guerry (Postfix, from userid 1000) id DF0F61A6032B; Fri, 24 Jan 2020 11:06:19 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244562 Archived-At: --=-=-= Content-Type: text/plain Hi Paul, 07a4dd8e6a introduces a change in the behavior of `parse-time-string': (parse-time-string "2020-12-12") [before 07a4dd8e6a] => (nil nil nil 12 12 2020 nil nil nil) [after 07a4dd8e6a] => (0 0 0 12 12 2020 nil -1 nil) The current docstring seems to suggest that the current implementation should return (nil nil nil 12 12 2020 nil -1 nil). I suggest the attached patch to revert to the previous behavior while still having the benefits of the new implementation. The new behavior causes an annoying bug in Org-mode: re-scheduling a headline from the calendar introduces a default time value ("00:00") even when there is no time in the timestamp. WDYT? Thanks, -- Bastien --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=parse-time.el.patch diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 6a4612297c..b199fca2db 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -158,7 +158,7 @@ parse-time-string any unknown values other than DST are returned as nil, and an unknown DST value is returned as -1." (condition-case () - (decoded-time-set-defaults (iso8601-parse string)) + (iso8601-parse string) (wrong-type-argument (let ((time (list nil nil nil nil nil nil nil -1 nil)) (temp (parse-time-tokenize (downcase string)))) --=-=-=--