Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pomidor history: Symbol's function definition is void: parse-iso8601-time-string #52

Open
ghost opened this issue Jun 28, 2021 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 28, 2021

Hi,

When I attempt to look at pomidor history, I get the message error. I found some issues with parsing in emacs here, but I'm not sure how to fix it for pomidor.

https://emacs.stackexchange.com/questions/60175/parse-time-string-doesnt-accept-iso-8601-string-contrary-to-what-the-documenta

@TatriX
Copy link
Owner

TatriX commented Jun 29, 2021

Hey! What Emacs version do you use?

@ghost
Copy link
Author

ghost commented Jun 29, 2021

Though I had the latest version, but it's 25.5. This error is apparently fixed in 28.0 version of emacs. Upgrading it should be good I guess. In the meantime, if you have an idea of how to fix it by changing a bit your code I'm interested ;) Sounds simple, maybe it's not, I'm not familiar with lisp.

@TatriX
Copy link
Owner

TatriX commented Jun 30, 2021

As you already have specific Emacs version, it would be really nice if you could test if the workaround from the stackoverflow post works.

For example you can eval this code and see if it solves the problem.

(defun pomidor--read-session (preserve-timestamp?)
  "Read the saved sessions."
  (let* ((json-object-type 'plist)
         (json-array-type 'list)
         (data (json-read-file pomidor-save-session-file)))
    (if preserve-timestamp?
        data
      (-map (lambda (pomidor)
              (-map (lambda (v) (if (stringp v)
                                    (decode-time 
                                     (parse-iso8601-time-string v))
                             v))
                    pomidor))
            data))))

@ghost
Copy link
Author

ghost commented Jul 2, 2021

Hi TatriX,

Adding decode-time does not work, but I tried the evaluations in the following order :

(parse-iso8601-time-string "1998-09-12T12:21:54-0200") -> does not work                                                                     
                                                                                                                                                              
(parse-time-string "1998-09-12T12:21:54-0200") -> gives (nil nil nil nil nil nil nil nil nil) as expected                                                              
                                                                                                                           
(parse-iso8601-time-string "1998-09-12T12:21:54-0200") -> gives coded time (13818 19266)                                                                      
                                                                                                                                                              
(decode-time (parse-iso8601-time-string "1998-09-12T12:21:54-0200")) -> (54 21 12 12 9 1998 6 t 7200) 

And this work ! So there is a weird bug solved by running parse-time-string before parse-iso-8061-time-string apparently.

@TatriX
Copy link
Owner

TatriX commented Jul 4, 2021

I don't really use history functionality.
@wandersoncferreira if you could check the solution from the comment above it would be very kind of you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant