0

I have the following code:

(decoded-time-add
 (make-decoded-time
  :day 1
  :month 1
  :year 2023)
 (make-decoded-time :year 1))

When I execute this the following warning gets put out:

obsolete timestamp with cdr 1 [10 times]

Apparently there is a new time format since 2018. This change also adds the warning that gets triggered, but I don't understand how this gets triggered through this code.

If I change the code to the following:

(decoded-time-add
 (make-decoded-time
  :hour 0
  :day 1
  :month 1
  :year 2023)
 (make-decoded-time :hour 100000))

Emacs freezes noticeably before producing the result and prints way more warning:

obsolete timestamp with cdr 1 [8342 times]

I'm using GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2023-01-19.

From reading the documentation of decoded-time-add I think the inputs passed to the function should be valid and the function is not deprecated. Why does the call still produce a warning and why does it freeze my Emacs for certain inputs?

2
  • emacs.stackexchange.com/tags/elisp/info
    – Drew
    Jan 30, 2023 at 20:29
  • So is this what your question is: I don't understand how this gets triggered through this code. You want to know how it gets triggered? If so, please make that your question explicitly. Thx.
    – Drew
    Jan 30, 2023 at 20:31

1 Answer 1

1

This seems like a bug in Emacs 28 which has since been fixed for Emacs 29.

Using debug-on-message in Emacs 28.2 I see (time-add (0 . 1) (0 . 1)) being called and triggering that "obsolete timestamp with cdr 1" error message. That's getting triggered within decoded-time-add, and I can't see anything obviously wrong with your arguments.

In my build of Emacs 29 I see no error and no freezing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.