* Re: gnus-icalendar errors in emacs 24.5 [not found] <mailman.5404.1456174176.843.help-gnu-emacs@gnu.org> @ 2016-02-23 1:41 ` Lars Magne Ingebrigtsen 2016-02-23 9:13 ` Kostas Zorbadelos 2016-02-23 10:13 ` Jan Tatarik 0 siblings, 2 replies; 6+ messages in thread From: Lars Magne Ingebrigtsen @ 2016-02-23 1:41 UTC (permalink / raw) To: Kostas Zorbadelos; +Cc: help-gnu-emacs, Jan Tatarik Kostas Zorbadelos <kzorba@otenet.gr> writes: > Org file exists and has a 'Calendar' headline. > On export of a calendar mail (attached the calendar MIME part) I get the > attached backtrace. I get the same backtrace even when I send a gmail > calendar invitation. Any suggestions? [...] > Debugger entered--Lisp error: (error "Invalid date: 2016-02-25 Πεμ") > signal(error ("Invalid date: 2016-02-25 Πεμ")) > error("Invalid date: %s" "2016-02-25 Πεμ") > date-to-time("2016-02-25 Πεμ") This is definitely a bug, and it comes from here: (cl-defmethod gnus-icalendar-event:org-timestamp ((event gnus-icalendar-event)) "Build `org-mode' timestamp from EVENT start/end dates and recurrence info." (let* ((start (gnus-icalendar-event:start-time event)) (end (gnus-icalendar-event:end-time event)) (start-date (format-time-string "%Y-%m-%d %a" start)) %a is the locale's day name, and that's not something `date-to-time' can parse. But I'm not familiar with gnus-icalendar, so I'm not sure what the right fix is here. Jan, is the week day supposed to be in these date strings at all? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-icalendar errors in emacs 24.5 2016-02-23 1:41 ` gnus-icalendar errors in emacs 24.5 Lars Magne Ingebrigtsen @ 2016-02-23 9:13 ` Kostas Zorbadelos 2016-02-23 10:13 ` Jan Tatarik 1 sibling, 0 replies; 6+ messages in thread From: Kostas Zorbadelos @ 2016-02-23 9:13 UTC (permalink / raw) To: Lars Magne Ingebrigtsen; +Cc: help-gnu-emacs, Jan Tatarik Lars, thank you so much. The problem is indeed my Greek locale that causes failure in date-to-time(). I made the following patch --- gnus-icalendar.el.orig 2016-02-23 09:04:49.755027543 +0200 +++ gnus-icalendar.el 2016-02-23 10:57:03.759362183 +0200 @@ -389,10 +389,10 @@ "Build `org-mode' timestamp from EVENT start/end dates and recurrence info." (let* ((start (gnus-icalendar-event:start-time event)) (end (gnus-icalendar-event:end-time event)) - (start-date (format-time-string "%Y-%m-%d %a" start)) + (start-date (format-time-string "%Y-%m-%dT%T%z" start)) (start-time (format-time-string "%H:%M" start)) (start-at-midnight (string= start-time "00:00")) - (end-date (format-time-string "%Y-%m-%d %a" end)) + (end-date (format-time-string "%Y-%m-%dT%T%z" end)) (end-time (format-time-string "%H:%M" end)) (end-at-midnight (string= end-time "00:00")) (start-end-date-diff (/ (float-time (time-subtract that seems to work. Jan, as the author has the final saying in this, hopefully it doesn't break anything else, or there is just a better solution. Hopefully it will be fixed in later versions of Emacs. Again, thanks, it is a pleasure to finally get rid of Thunderbird and have a plain text calendaring that works. Regards, Kostas Lars Magne Ingebrigtsen <lmi@gnus.org> writes: > Kostas Zorbadelos <kzorba@otenet.gr> writes: > >> Org file exists and has a 'Calendar' headline. >> On export of a calendar mail (attached the calendar MIME part) I get the >> attached backtrace. I get the same backtrace even when I send a gmail >> calendar invitation. Any suggestions? > > [...] > >> Debugger entered--Lisp error: (error "Invalid date: 2016-02-25 Πεμ") >> signal(error ("Invalid date: 2016-02-25 Πεμ")) >> error("Invalid date: %s" "2016-02-25 Πεμ") >> date-to-time("2016-02-25 Πεμ") > > This is definitely a bug, and it comes from here: > > (cl-defmethod gnus-icalendar-event:org-timestamp ((event gnus-icalendar-event)) > "Build `org-mode' timestamp from EVENT start/end dates and recurrence info." > (let* ((start (gnus-icalendar-event:start-time event)) > (end (gnus-icalendar-event:end-time event)) > (start-date (format-time-string "%Y-%m-%d %a" start)) > > %a is the locale's day name, and that's not something `date-to-time' can > parse. But I'm not familiar with gnus-icalendar, so I'm not sure what > the right fix is here. > > Jan, is the week day supposed to be in these date strings at all? -- Kostas Zorbadelos http://gr.linkedin.com/in/kzorba ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-icalendar errors in emacs 24.5 2016-02-23 1:41 ` gnus-icalendar errors in emacs 24.5 Lars Magne Ingebrigtsen 2016-02-23 9:13 ` Kostas Zorbadelos @ 2016-02-23 10:13 ` Jan Tatarik 2016-02-23 10:16 ` Lars Ingebrigtsen 1 sibling, 1 reply; 6+ messages in thread From: Jan Tatarik @ 2016-02-23 10:13 UTC (permalink / raw) To: Lars Magne Ingebrigtsen; +Cc: help-gnu-emacs, Kostas Zorbadelos [-- Attachment #1: Type: text/plain, Size: 802 bytes --] On Tue, Feb 23 2016, Lars Magne Ingebrigtsen wrote: [...] > This is definitely a bug, and it comes from here: > (cl-defmethod gnus-icalendar-event:org-timestamp ((event gnus-icalendar-event)) > "Build `org-mode' timestamp from EVENT start/end dates and recurrence info." > (let* ((start (gnus-icalendar-event:start-time event)) > (end (gnus-icalendar-event:end-time event)) > (start-date (format-time-string "%Y-%m-%d %a" start)) > %a is the locale's day name, and that's not something `date-to-time' can > parse. But I'm not familiar with gnus-icalendar, so I'm not sure what > the right fix is here. > Jan, is the week day supposed to be in these date strings at all? How about this? It's a patch against the emacs-25 branch, I was not able to connect to the gnus git. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: text/x-diff, Size: 851 bytes --] diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index 4faef06..82a649f 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -401,8 +401,8 @@ gnus-icalendar-event:org-timestamp (end-time (format-time-string "%H:%M" end)) (end-at-midnight (string= end-time "00:00")) (start-end-date-diff (/ (float-time (time-subtract - (date-to-time end-date) - (date-to-time start-date))) + (org-time-string-to-time end-date) + (org-time-string-to-time start-date))) 86400)) (org-repeat (gnus-icalendar-event:org-repeat event)) (repeat (if org-repeat (concat " " org-repeat) "")) ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: gnus-icalendar errors in emacs 24.5 2016-02-23 10:13 ` Jan Tatarik @ 2016-02-23 10:16 ` Lars Ingebrigtsen 2016-02-23 10:35 ` gnus-icalendar errors in emacs 24.5 [FIXED] Kostas Zorbadelos 0 siblings, 1 reply; 6+ messages in thread From: Lars Ingebrigtsen @ 2016-02-23 10:16 UTC (permalink / raw) To: Jan Tatarik; +Cc: help-gnu-emacs, Kostas Zorbadelos Jan Tatarik <jan.tatarik@gmail.com> writes: > How about this? It's a patch against the emacs-25 branch, I was not able > to connect to the gnus git. The Gnus git repository is now read-only (and only with anonymous access). > diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el > index 4faef06..82a649f 100644 > --- a/lisp/gnus/gnus-icalendar.el > +++ b/lisp/gnus/gnus-icalendar.el > @@ -401,8 +401,8 @@ gnus-icalendar-event:org-timestamp > (end-time (format-time-string "%H:%M" end)) > (end-at-midnight (string= end-time "00:00")) > (start-end-date-diff (/ (float-time (time-subtract > - (date-to-time end-date) > - (date-to-time start-date))) > + (org-time-string-to-time end-date) > + (org-time-string-to-time start-date))) Yes, this seems to fix the problem. I'll apply to emacs-25 and push. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-icalendar errors in emacs 24.5 [FIXED] 2016-02-23 10:16 ` Lars Ingebrigtsen @ 2016-02-23 10:35 ` Kostas Zorbadelos 2016-02-23 14:25 ` gnus-icalendar errors in emacs 24.5 [timezone issue] Kostas Zorbadelos 0 siblings, 1 reply; 6+ messages in thread From: Kostas Zorbadelos @ 2016-02-23 10:35 UTC (permalink / raw) To: Lars Ingebrigtsen; +Cc: help-gnu-emacs, Jan Tatarik Lars Ingebrigtsen <larsi@gnus.org> writes: > Jan Tatarik <jan.tatarik@gmail.com> writes: > >> How about this? It's a patch against the emacs-25 branch, I was not able >> to connect to the gnus git. > > The Gnus git repository is now read-only (and only with anonymous > access). > >> diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el >> index 4faef06..82a649f 100644 >> --- a/lisp/gnus/gnus-icalendar.el >> +++ b/lisp/gnus/gnus-icalendar.el >> @@ -401,8 +401,8 @@ gnus-icalendar-event:org-timestamp >> (end-time (format-time-string "%H:%M" end)) >> (end-at-midnight (string= end-time "00:00")) >> (start-end-date-diff (/ (float-time (time-subtract >> - (date-to-time end-date) >> - (date-to-time start-date))) >> + (org-time-string-to-time end-date) >> + (org-time-string-to-time start-date))) > > Yes, this seems to fix the problem. I'll apply to emacs-25 and push. This seems to work as well in 24.5. My proposal broke the dates in the agenda buffer. Now I have a different problem, showing Greek (or other international text I guess) in calendar invitations. I will start a new thread for this. Thanks, Kostas -- Kostas Zorbadelos http://gr.linkedin.com/in/kzorba ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-icalendar errors in emacs 24.5 [timezone issue] 2016-02-23 10:35 ` gnus-icalendar errors in emacs 24.5 [FIXED] Kostas Zorbadelos @ 2016-02-23 14:25 ` Kostas Zorbadelos 0 siblings, 0 replies; 6+ messages in thread From: Kostas Zorbadelos @ 2016-02-23 14:25 UTC (permalink / raw) To: Jan Tatarik; +Cc: Lars Ingebrigtsen, help-gnu-emacs Kostas Zorbadelos <kzorba@otenet.gr> writes: Hello, time handling is never trivial, it seems. When the calendar sender is in a different timezone, the extracted event does not seem to be converted to my timezone. I need more reading and understanding of the code to find out where the issue is (e.g what exactly are start, end below in (defmethod gnus-icalendar-event:org-timestamp ((event gnus-icalendar-event)) ... (start (gnus-icalendar-event:start-time event)) (end (gnus-icalendar-event:end-time event)) ... ). In case you have any ideas, or I am missing something, please share. Regards, Kostas > Lars Ingebrigtsen <larsi@gnus.org> writes: > >> Jan Tatarik <jan.tatarik@gmail.com> writes: >> >>> How about this? It's a patch against the emacs-25 branch, I was not able >>> to connect to the gnus git. >> >> The Gnus git repository is now read-only (and only with anonymous >> access). >> >>> diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el >>> index 4faef06..82a649f 100644 >>> --- a/lisp/gnus/gnus-icalendar.el >>> +++ b/lisp/gnus/gnus-icalendar.el >>> @@ -401,8 +401,8 @@ gnus-icalendar-event:org-timestamp >>> (end-time (format-time-string "%H:%M" end)) >>> (end-at-midnight (string= end-time "00:00")) >>> (start-end-date-diff (/ (float-time (time-subtract >>> - (date-to-time end-date) >>> - (date-to-time start-date))) >>> + (org-time-string-to-time end-date) >>> + (org-time-string-to-time start-date))) >> >> Yes, this seems to fix the problem. I'll apply to emacs-25 and push. > -- Kostas Zorbadelos http://gr.linkedin.com/in/kzorba ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-02-23 14:25 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <mailman.5404.1456174176.843.help-gnu-emacs@gnu.org> 2016-02-23 1:41 ` gnus-icalendar errors in emacs 24.5 Lars Magne Ingebrigtsen 2016-02-23 9:13 ` Kostas Zorbadelos 2016-02-23 10:13 ` Jan Tatarik 2016-02-23 10:16 ` Lars Ingebrigtsen 2016-02-23 10:35 ` gnus-icalendar errors in emacs 24.5 [FIXED] Kostas Zorbadelos 2016-02-23 14:25 ` gnus-icalendar errors in emacs 24.5 [timezone issue] Kostas Zorbadelos
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).