GNU bug report logs - #48298
Invalid time specification: encode-time((0 30 11 1 1 0 nil -1 nil))

Previous Next

Package: emacs;

Reported by: Евгений Михайлов <lewwadoo <at> gmail.com>

Date: Sat, 8 May 2021 20:59:01 UTC

Severity: normal

Merged with 48290

Found in versions 27.1, 27.2

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48298 in the body.
You can then email your comments to 48298 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sat, 08 May 2021 20:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Евгений Михайлов <lewwadoo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 08 May 2021 20:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Евгений Михайлов
 <lewwadoo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Invalid time specification: encode-time((0 30 11 1 1 0 nil -1 nil))
Date: Sat, 8 May 2021 19:55:10 +0300
[Message part 1 (text/plain, inline)]
(my-mins-between "11:30" "12:04")

(defun my-mins-between (time1 time2)
  "Return the minutes between HH:mm strings TIME1 and TIME2."
  (let ((diff (apply #'time-subtract
                     (mapcar (lambda (time)
                               (encode-time (decoded-time-set-defaults
                                             (parse-time-string time))))
                             (list time1 time2)))))
    (/ (float-time diff) 60)))

Debugger entered--Lisp error: (error "Invalid time specification")
  encode-time((0 30 11 1 1 0 nil -1 nil))
  (lambda (time) (encode-time (decoded-time-set-defaults (parse-time-string
time))))("11:30")
  mapcar((lambda (time) (encode-time (decoded-time-set-defaults
(parse-time-string time)))) ("11:30" "12:04"))


  In GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)
 of 2021-03-26 built on CIRROCUMULUS
Repository revision: deef5efafb70f4b171265b896505b92b6eef24e6
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.19041
System Description: Microsoft Windows 10 Home (v10.0.2004.19041.928)

Recent messages:
Quit
Mark set
Entering debugger...
Back to top level
my-mins-between
Entering debugger...
Back to top level
user-error: Beginning of history; no preceding item
user-error: End of history; no default available
scroll-up-command: End of buffer
command-execute: Command attempted to use minibuffer while in minibuffer
Configured using:
 'configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2
HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: RUS
  locale-coding-system: cp1251

Major mode: Emacs-Lisp

Minor modes in effect:
  global-company-mode: t
  company-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
c:/Users/pc/.emacs.d/elpa/flymake-1.1.1/flymake hides c:/Program
Files/Emacs/x86_64/share/emacs/27.2/lisp/progmodes/flymake
c:/Users/pc/.emacs.d/elpa/eldoc-1.11.0/eldoc hides c:/Program
Files/Emacs/x86_64/share/emacs/27.2/lisp/emacs-lisp/eldoc

Features:
(shadow sort mail-extr emacsbug sendmail help-fns radix-tree cl-print
debug backtrace bookmark pp gnutls network-stream url-http url-gw nsm
url-cache url-auth org-habitica vc-git diff-mode cl-extra help-mode
org-element avl-tree ol-eww eww mm-url url-queue ol-rmail ol-mhe ol-irc
ol-info ol-gnus nnir gnus-sum url url-proxy url-privacy url-expand
url-methods url-history mailcap shr url-cookie url-domsuf url-util svg
xml dom gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int
gnus-range message rmc puny rfc822 mml mml-sec epa derived epg
epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search
mail-utils mm-util mail-prsvr wid-edit ol-docview doc-view jka-compr
image-mode exif dired dired-loaddefs ol-bibtex bibtex ol-bbdb ol-w3m
face-remap org-agenda org-refile org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete
org-list org-faces org-entities time-date noutline outline easy-mmode
org-version ob-emacs-lisp ob-core ob-eval org-table org-keys
org-loaddefs find-func cal-menu calendar cal-loaddefs ol org-compat
advice org-macs format-spec company-oddmuse company-keywords
company-etags etags fileloop generator xref project company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-capf company-cmake company-semantic company-template
company-bbdb company zerodark-theme let-alist pcase org-capture-complex
report 1cfresh process-1cbases process-docs flymake-proc flymake compile
comint ansi-color ring warnings thingatpt string-inflection
helm-easymenu edmacro kmacro rx info package easymenu browse-url
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads w32notify w32
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 367719 37867)
 (symbols 48 24682 1)
 (strings 32 86256 2807)
 (string-bytes 1 3071501)
 (vectors 16 43765)
 (vector-slots 8 1238429 232140)
 (floats 8 271 108)
 (intervals 56 3530 533)
 (buffers 1000 33))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sat, 08 May 2021 22:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Евгений Михайлов
 <lewwadoo <at> gmail.com>
Cc: 48298 <at> debbugs.gnu.org
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sat, 08 May 2021 23:37:43 +0100
forcemerge 48290 48298
quit

Евгений Михайлов <lewwadoo <at> gmail.com> writes:

> (my-mins-between "11:30" "12:04")
>
> (defun my-mins-between (time1 time2)
>   "Return the minutes between HH:mm strings TIME1 and TIME2."
>   (let ((diff (apply #'time-subtract
>                      (mapcar (lambda (time)
>                                (encode-time (decoded-time-set-defaults
>                                              (parse-time-string time))))
>                              (list time1 time2)))))
>     (/ (float-time diff) 60)))
>
> Debugger entered--Lisp error: (error "Invalid time specification")
>   encode-time((0 30 11 1 1 0 nil -1 nil))
>   (lambda (time) (encode-time (decoded-time-set-defaults (parse-time-string time))))("11:30")
>   mapcar((lambda (time) (encode-time (decoded-time-set-defaults (parse-time-string time)))) ("11:30" "12:04"))

I'm not sure what happened that resulted in two bug reports being
submitted, but this looks like the missing description from
https://bugs.gnu.org/48290, so I'm merging the two reports.

Thanks,

-- 
Basil




Forcibly Merged 48290 48298. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sat, 08 May 2021 22:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 06:48:02 GMT) Full text and rfc822 format available.

Message #13 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Евгений Михайлов
 <lewwadoo <at> gmail.com>
Cc: 48298 <at> debbugs.gnu.org
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1 0
 nil -1 nil))
Date: Sun, 09 May 2021 09:46:56 +0300
> From: Евгений Михайлов
>  <lewwadoo <at> gmail.com>
> Date: Sat, 8 May 2021 19:55:10 +0300
> 
> (my-mins-between "11:30" "12:04")
> 
> (defun my-mins-between (time1 time2)
>   "Return the minutes between HH:mm strings TIME1 and TIME2."
>   (let ((diff (apply #'time-subtract
>                      (mapcar (lambda (time)
>                                (encode-time (decoded-time-set-defaults
>                                              (parse-time-string time))))
>                              (list time1 time2)))))
>     (/ (float-time diff) 60)))
> 
> Debugger entered--Lisp error: (error "Invalid time specification")
>   encode-time((0 30 11 1 1 0 nil -1 nil))
>   (lambda (time) (encode-time (decoded-time-set-defaults (parse-time-string time))))("11:30")
>   mapcar((lambda (time) (encode-time (decoded-time-set-defaults (parse-time-string time)))) ("11:30"
> "12:04"))

I guess the problem is in decoded-time-set-defaults, if anywhere.

However, I'm not sure I understand the idea behind your
my-mins-between: how did you expect Emacs to guess the year you had in
mind?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 07:08:01 GMT) Full text and rfc822 format available.

Message #16 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1 0
 nil -1 nil))
Date: Sun, 09 May 2021 10:07:08 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Date: Sat, 08 May 2021 23:37:43 +0100
> Cc: 48298 <at> debbugs.gnu.org
> 
> I'm not sure what happened that resulted in two bug reports being
> submitted, but this looks like the missing description from
> https://bugs.gnu.org/48290, so I'm merging the two reports.

Thanks.  Bug reports without a single word of explanation are indeed
hard to process.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 07:31:02 GMT) Full text and rfc822 format available.

Message #19 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Евгений Михайлов
 <lewwadoo <at> gmail.com>
Cc: 48298 <at> debbugs.gnu.org
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 09:30:23 +0200
On Mai 08 2021, Евгений Михайлов wrote:

> (my-mins-between "11:30" "12:04")
>
> (defun my-mins-between (time1 time2)
>   "Return the minutes between HH:mm strings TIME1 and TIME2."

This isn't well defined: there may be a DST switchover between the two
timestamps.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 08:20:01 GMT) Full text and rfc822 format available.

Message #22 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 48298 <at> debbugs.gnu.org,
 Евгений Михайлов
 <lewwadoo <at> gmail.com>
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 09:19:47 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Евгений Михайлов
>>  <lewwadoo <at> gmail.com>
>> Date: Sat, 8 May 2021 19:55:10 +0300
>> 
>> (my-mins-between "11:30" "12:04")
>> 
>> (defun my-mins-between (time1 time2)
>>   "Return the minutes between HH:mm strings TIME1 and TIME2."
>>   (let ((diff (apply #'time-subtract
>>                      (mapcar (lambda (time)
>>                                (encode-time (decoded-time-set-defaults
>>                                              (parse-time-string time))))
>>                              (list time1 time2)))))
>>     (/ (float-time diff) 60)))
>> 
>> Debugger entered--Lisp error: (error "Invalid time specification")
>>   encode-time((0 30 11 1 1 0 nil -1 nil))
>>   (lambda (time) (encode-time (decoded-time-set-defaults (parse-time-string time))))("11:30")
>>   mapcar((lambda (time) (encode-time (decoded-time-set-defaults (parse-time-string time)))) ("11:30"
>> "12:04"))
>
> I guess the problem is in decoded-time-set-defaults, if anywhere.

Lars?

FWIW there is a similar pattern in the function iso8601--encode-time.

BTW I just noticed that decoded-time-set-defaults was mistakenly
announced in NEWS as encoded-time-set-defaults - should that be fixed on
emacs-27 or master?

> However, I'm not sure I understand the idea behind your
> my-mins-between: how did you expect Emacs to guess the year you had in
> mind?

The year doesn't matter, since my-mins-between cares only about the
relative difference between strings of the form "HH:mm", i.e. the hours
and minutes fields.

The other decoded time fields resulting from parsing don't matter, as
long as they are equivalent for both strings.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 08:28:01 GMT) Full text and rfc822 format available.

Message #25 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: larsi <at> gnus.org, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 11:27:32 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: Евгений Михайлов
>  <lewwadoo <at> gmail.com>,  48298 <at> debbugs.gnu.org
> Date: Sun, 09 May 2021 09:19:47 +0100
> 
> > I guess the problem is in decoded-time-set-defaults, if anywhere.
> 
> Lars?

As the minimum fix, perhaps instead of using zero as the missing year
we should use 1970, as zero could not be representable on some
systems.

> BTW I just noticed that decoded-time-set-defaults was mistakenly
> announced in NEWS as encoded-time-set-defaults - should that be fixed on
> emacs-27 or master?

Master, I guess.

> > However, I'm not sure I understand the idea behind your
> > my-mins-between: how did you expect Emacs to guess the year you had in
> > mind?
> 
> The year doesn't matter, since my-mins-between cares only about the
> relative difference between strings of the form "HH:mm", i.e. the hours
> and minutes fields.

Yes, it does matter: see the comment by Andreas.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 08:55:01 GMT) Full text and rfc822 format available.

Message #28 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 09:54:32 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>> Cc: Евгений Михайлов
>>  <lewwadoo <at> gmail.com>,  48298 <at> debbugs.gnu.org
>> Date: Sun, 09 May 2021 09:19:47 +0100
>> 
>> > I guess the problem is in decoded-time-set-defaults, if anywhere.
>> 
>> Lars?
>
> As the minimum fix, perhaps instead of using zero as the missing year
> we should use 1970, as zero could not be representable on some
> systems.

Also 1970 is implied by the function's docstring and announcement.

All tests seem to pass with this:

[0001-Default-to-1970-in-decoded-time-set-defaults.patch (text/x-diff, inline)]
From 3bb0de4f76265d3be28c0b38046f1a08d93259b9 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Date: Sun, 9 May 2021 09:50:00 +0100
Subject: [PATCH] Default to 1970 in decoded-time-set-defaults

* lisp/calendar/time-date.el (decoded-time-set-defaults): Set an
unspecified year field to 1970, as promised in the docstring, and to
ensure it's representable on all systems (bug#48298).
---
 lisp/calendar/time-date.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 2df57a3c33..e93a74810d 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -539,7 +539,7 @@ decoded-time-set-defaults
   (unless (decoded-time-month time)
     (setf (decoded-time-month time) 1))
   (unless (decoded-time-year time)
-    (setf (decoded-time-year time) 0))
+    (setf (decoded-time-year time) 1970))
 
   ;; When we don't have a time zone, default to DEFAULT-ZONE without
   ;; DST if DEFAULT-ZONE if given, and to unknown DST otherwise.
-- 
2.30.2

[Message part 3 (text/plain, inline)]
Evgeny, does that fix the error that you see?

>> BTW I just noticed that decoded-time-set-defaults was mistakenly
>> announced in NEWS as encoded-time-set-defaults - should that be fixed on
>> emacs-27 or master?
>
> Master, I guess.

Done in 3d276324ed.

>> > However, I'm not sure I understand the idea behind your
>> > my-mins-between: how did you expect Emacs to guess the year you had in
>> > mind?
>> 
>> The year doesn't matter, since my-mins-between cares only about the
>> relative difference between strings of the form "HH:mm", i.e. the hours
>> and minutes fields.
>
> Yes, it does matter: see the comment by Andreas.

In general, sure, but perhaps not in Evgeny's specific use case as
described in https://bugs.gnu.org/48290#11.

Thanks,

-- 
Basil

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 09:53:02 GMT) Full text and rfc822 format available.

Message #31 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 11:52:06 +0200
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

>    (unless (decoded-time-year time)
> -    (setf (decoded-time-year time) 0))
> +    (setf (decoded-time-year time) 1970))

Sure; that makes as much sense as anything, but the doc string should
perhaps mention it.  (All the other defaults are as zero-ish as
possible, and 1970 is used here only because of technical limitations.) 

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 10:05:02 GMT) Full text and rfc822 format available.

Message #34 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 11:03:59 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>>    (unless (decoded-time-year time)
>> -    (setf (decoded-time-year time) 0))
>> +    (setf (decoded-time-year time) 1970))
>
> Sure; that makes as much sense as anything, but the doc string should
> perhaps mention it.

It already does:

  The default value is based on January 1st, 1970 at midnight.

Can it be clarified further?

> (All the other defaults are as zero-ish as possible, and 1970 is used
> here only because of technical limitations.)

Is it worth mentioning in the docstring that 1970 is chosen to guarantee
portability, similar to the note in encode-time's docstring?

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 10:10:01 GMT) Full text and rfc822 format available.

Message #37 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 12:09:41 +0200
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> It already does:
>
>   The default value is based on January 1st, 1970 at midnight.
>
> Can it be clarified further?

Oh, so it was just a bug...

>> (All the other defaults are as zero-ish as possible, and 1970 is used
>> here only because of technical limitations.)
>
> Is it worth mentioning in the docstring that 1970 is chosen to guarantee
> portability, similar to the note in encode-time's docstring?

Sure; makes sense.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 10:36:01 GMT) Full text and rfc822 format available.

Message #40 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: larsi <at> gnus.org, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 13:35:15 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: larsi <at> gnus.org,  lewwadoo <at> gmail.com,  48298 <at> debbugs.gnu.org
> Date: Sun, 09 May 2021 09:54:32 +0100
> 
> >> BTW I just noticed that decoded-time-set-defaults was mistakenly
> >> announced in NEWS as encoded-time-set-defaults - should that be fixed on
> >> emacs-27 or master?
> >
> > Master, I guess.
> 
> Done in 3d276324ed.

You've changed NEWS.27, it seems?  That's not what I meant, it will
just create merge conflicts when NEWS from emacs-27 are merged.  I
thought you were talking about NEWS on master, not NEWS.27.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 11:00:02 GMT) Full text and rfc822 format available.

Message #43 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 11:59:04 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>> Cc: larsi <at> gnus.org,  lewwadoo <at> gmail.com,  48298 <at> debbugs.gnu.org
>> Date: Sun, 09 May 2021 09:54:32 +0100
>> 
>> >> BTW I just noticed that decoded-time-set-defaults was mistakenly
>> >> announced in NEWS as encoded-time-set-defaults - should that be fixed on
>> >> emacs-27 or master?
>> >
>> > Master, I guess.
>> 
>> Done in 3d276324ed.
>
> You've changed NEWS.27, it seems?  That's not what I meant, it will
> just create merge conflicts when NEWS from emacs-27 are merged.  I
> thought you were talking about NEWS on master, not NEWS.27.

Sorry.  Should I revert that commit on master and make the change in
etc/NEWS on emacs-27 instead?

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 11:03:02 GMT) Full text and rfc822 format available.

Message #46 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 12:02:06 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> It already does:
>>
>>   The default value is based on January 1st, 1970 at midnight.
>>
>> Can it be clarified further?
>
> Oh, so it was just a bug...
>
>>> (All the other defaults are as zero-ish as possible, and 1970 is used
>>> here only because of technical limitations.)
>>
>> Is it worth mentioning in the docstring that 1970 is chosen to guarantee
>> portability, similar to the note in encode-time's docstring?
>
> Sure; makes sense.

Done:

Default to 1970 in decoded-time-set-defaults
b376ed7220 2021-05-09 11:52:20 +0100
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=b376ed72204193eba652666fa2540f412f456490

Evgeny, does that solve your issue?

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 11:50:01 GMT) Full text and rfc822 format available.

Message #49 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: larsi <at> gnus.org, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 14:49:46 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: larsi <at> gnus.org,  lewwadoo <at> gmail.com,  48298 <at> debbugs.gnu.org
> Date: Sun, 09 May 2021 11:59:04 +0100
> 
> >> > Master, I guess.
> >> 
> >> Done in 3d276324ed.
> >
> > You've changed NEWS.27, it seems?  That's not what I meant, it will
> > just create merge conflicts when NEWS from emacs-27 are merged.  I
> > thought you were talking about NEWS on master, not NEWS.27.
> 
> Sorry.  Should I revert that commit on master and make the change in
> etc/NEWS on emacs-27 instead?

Yes, please.

(I thought you asked about the branch because this could also be
called out in Emacs 28's NEWS in some way.  Sorry for my
misunderstanding.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Sun, 09 May 2021 13:59:02 GMT) Full text and rfc822 format available.

Message #52 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 48298 <at> debbugs.gnu.org, lewwadoo <at> gmail.com
Subject: Re: bug#48298: Invalid time specification: encode-time((0 30 11 1 1
 0 nil -1 nil))
Date: Sun, 09 May 2021 14:57:58 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>> Cc: larsi <at> gnus.org,  lewwadoo <at> gmail.com,  48298 <at> debbugs.gnu.org
>> Date: Sun, 09 May 2021 11:59:04 +0100
>> 
>> >> > Master, I guess.
>> >> 
>> >> Done in 3d276324ed.
>> >
>> > You've changed NEWS.27, it seems?  That's not what I meant, it will
>> > just create merge conflicts when NEWS from emacs-27 are merged.  I
>> > thought you were talking about NEWS on master, not NEWS.27.
>> 
>> Sorry.  Should I revert that commit on master and make the change in
>> etc/NEWS on emacs-27 instead?
>
> Yes, please.

Done:

; * etc/NEWS.27: Revert last change.
3d2c892114 2021-05-09 14:49:23 +0100
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=3d2c892114ebd35cb10928bb87f991316a0ca55c

; * etc/NEWS: Fix decoded-time-set-defaults typo.
c233f4eccd 2021-05-09 14:46:27 +0100
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=c233f4eccddf09e41441b2a292491b469fd61792

> (I thought you asked about the branch because this could also be
> called out in Emacs 28's NEWS in some way.  Sorry for my
> misunderstanding.)

No, it's my fault for not making that clear.  Sorry for any issues it
causes.

Thanks,

-- 
Basil




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 11 May 2021 13:30:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Tue, 11 May 2021 20:58:02 GMT) Full text and rfc822 format available.

Message #57 received at 48298 <at> debbugs.gnu.org (full text, mbox):

From: Евгений Михайлов
 <lewwadoo <at> gmail.com>
To: 48298 <at> debbugs.gnu.org
Date: Tue, 11 May 2021 23:56:49 +0300
[Message part 1 (text/plain, inline)]
вс, 9 мая 2021 г. в 11:54, Basil L. Contovounesios <contovob <at> tcd.ie>:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> >> Cc: Евгений Михайлов
> >>  <lewwadoo <at> gmail.com>,  48298 <at> debbugs.gnu.org
> >> Date: Sun, 09 May 2021 09:19:47 +0100
> >>
> >> > I guess the problem is in decoded-time-set-defaults, if anywhere.
> >>
> >> Lars?
> >
> > As the minimum fix, perhaps instead of using zero as the missing year
> > we should use 1970, as zero could not be representable on some
> > systems.
>
> Also 1970 is implied by the function's docstring and announcement.
>
> All tests seem to pass with this:
>
>
> Evgeny, does that fix the error that you see?
>

It does! (encode-time '(0 30 11 1 1 1970 nil -1 nil)) yielded (0 30600).
Thank you guys for your help!
[Message part 2 (text/html, inline)]

Removed tag(s) moreinfo. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Tue, 11 May 2021 21:38:01 GMT) Full text and rfc822 format available.

bug Marked as found in versions 27.1. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Tue, 11 May 2021 21:38:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 48298 <at> debbugs.gnu.org and Евгений Михайлов <lewwadoo <at> gmail.com> Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Tue, 11 May 2021 21:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48298; Package emacs. (Tue, 11 May 2021 21:38:02 GMT) Full text and rfc822 format available.

Message #66 received at 48298-done <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Евгений Михайлов
 <lewwadoo <at> gmail.com>
Cc: 48298-done <at> debbugs.gnu.org
Subject: Re: bug#48298:
Date: Tue, 11 May 2021 22:37:48 +0100
tags 48298 - moreinfo
found 48298 27.1
close 48298 28.1
quit

Евгений Михайлов <lewwadoo <at> gmail.com> writes:

> вс, 9 мая 2021 г. в 11:54, Basil L. Contovounesios <contovob <at> tcd.ie>:
>
>  Eli Zaretskii <eliz <at> gnu.org> writes:
>
>  >> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>  >> Cc: Евгений Михайлов
>  >>  <lewwadoo <at> gmail.com>,  48298 <at> debbugs.gnu.org
>  >> Date: Sun, 09 May 2021 09:19:47 +0100
>  >>
>  >> > I guess the problem is in decoded-time-set-defaults, if anywhere.
>  >>
>  >> Lars?
>  >
>  > As the minimum fix, perhaps instead of using zero as the missing year
>  > we should use 1970, as zero could not be representable on some
>  > systems.
>
>  Also 1970 is implied by the function's docstring and announcement.
>
>  All tests seem to pass with this:
>
>  Evgeny, does that fix the error that you see?
>
> It does! (encode-time '(0 30 11 1 1 1970 nil -1 nil)) yielded (0 30600). Thank you guys for your help!

Thanks for confirming.  I'm therefore closing this report.

-- 
Basil




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Jun 2021 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 321 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.