unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Fix for `parse-time-string'
@ 2020-01-24 10:06 Bastien
  2020-01-24 15:41 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2020-01-24 10:06 UTC (permalink / raw)
  To: emacs-devel; +Cc: Paul Eggert

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: parse-time.el.patch --]
[-- Type: text/x-diff, Size: 565 bytes --]

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))))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-25  8:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-24 10:06 [PATCH] Fix for `parse-time-string' Bastien
2020-01-24 15:41 ` Lars Ingebrigtsen
2020-01-24 21:45   ` Paul Eggert
2020-01-25  8:43     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).