emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: icalendar export skips todos with a scheduled time-range [7.8.11]
@ 2012-08-17 12:36 Friedrich Delgado
  2012-08-19  6:09 ` Bastien
  2012-08-19  6:15 ` Bastien
  0 siblings, 2 replies; 7+ messages in thread
From: Friedrich Delgado @ 2012-08-17 12:36 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

If I have an org-file containing a todo with a scheduled date range, like
this:

,----[ foo.org ]
  *** TODO Weekend with the lads
      SCHEDULED: <2012-05-04 Fr>--<2012-05-08 Di>
`----

and try to export it via org-export-icalendar-this-file, the resulting
foo.ics will look like this

,----[ foo.ics ]
  BEGIN:VCALENDAR
  VERSION:2.0
  X-WR-CALNAME:foo
  PRODID:-//Friedrich Delgado//Emacs with Org-mode//EN
  X-WR-TIMEZONE:Europe/Berlin
  X-WR-CALDESC:nil
  CALSCALE:GREGORIAN
  END:VCALENDAR
`----

(i.e.: contain no appointments at all)

I think the responsible section of code may reside in
[[file:/usr/share/emacs23/site-lisp/org-mode/org-icalendar.el::defun%20org-print-icalendar-entries][Function: org-print-icalendar-entries]]

(org-link for your convenience, I hope), more specifically starting
with line 360:

,----
      (if (looking-at re2)
          (progn
        (goto-char (match-end 0))
        (setq ts2 (match-string 1)
              inc (not (string-match "[0-9]\\{1,2\\}:[0-9][0-9]" ts2))))
        (setq tmp (buffer-substring (max (point-min)
                         (- pos org-ds-keyword-length))
                    pos)
          ts2 (if (string-match "[0-9]\\{1,2\\}:[0-9][0-9]-\\([0-9]\\{1,2\\}:[0-9][0-9]\\)" ts)
              (progn
                (setq inc nil)
                (replace-match "\\1" t nil ts))
            ts)
          deadlinep (string-match org-deadline-regexp tmp)
          scheduledp (string-match org-scheduled-regexp tmp)
          todo (org-get-todo-state)
          ;; donep (org-entry-is-done-p)
          ))
`----

From my basic understanding of the code-flow it looks like re2 ==
(concat "--?-?\\(" org-ts-regexp "\\)") is meant to match date-ranges,
but the code in the t branch of the if doesn't set deadlinep,
schedulep and todo, preventing all further processing of the entry.

But I may be wrong about the intentions of that function.

See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668496


Emacs  : GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2012-04-07 on trouble, modified by Debian
Package: Org-mode version 7.8.11

current state:
==============
(setq
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe
		      org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
		     org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
		  org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook org-show-block-all append local]
		   5]
		 #[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook org-babel-show-result-all append
		    local]
		   5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-interblocks '((src org-babel-exp-non-block-elements))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
			       org-beamer-auto-fragile-frames
			       org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-block nil)
		     (export-comment org-export-blocks-format-comment t)
		     (ditaa org-export-blocks-format-ditaa nil)
		     (dot org-export-blocks-format-dot nil))
 )
-- 
        Friedrich Delgado <friedel@nomaden.org>
Laziness led to the invention of the most useful tools.

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

* Re: Bug: icalendar export skips todos with a scheduled time-range [7.8.11]
  2012-08-17 12:36 Bug: icalendar export skips todos with a scheduled time-range [7.8.11] Friedrich Delgado
@ 2012-08-19  6:09 ` Bastien
  2012-08-19  6:15 ` Bastien
  1 sibling, 0 replies; 7+ messages in thread
From: Bastien @ 2012-08-19  6:09 UTC (permalink / raw)
  To: Friedrich Delgado; +Cc: emacs-orgmode

Hi Friedrich,

Friedrich Delgado <friedel@nomaden.org> writes:

> If I have an org-file containing a todo with a scheduled date range, like
> this:
>
> ,----[ foo.org ]
>   *** TODO Weekend with the lads
>       SCHEDULED: <2012-05-04 Fr>--<2012-05-08 Di>
> `----
>
> and try to export it via org-export-icalendar-this-file, the resulting
> foo.ics will look like this

With latest Org, the result for me looks like this:

,----
| BEGIN:VCALENDAR
| VERSION:2.0
| X-WR-CALNAME:test
| PRODID:-//Bastien Guerry//Emacs with Org-mode//EN
| X-WR-TIMEZONE:Europe/Paris
| X-WR-CALDESC:nil
| CALSCALE:GREGORIAN
| BEGIN:VEVENT
| UID: TS-9832a245-f98b-43a4-bf1a-e2f5ccbc1df2
| DTSTART;VALUE=DATE:20120504
| DTEND;VALUE=DATE:20120509
| SUMMARY:TODO Weekend with the lads
| CATEGORIES:test
| END:VEVENT
| BEGIN:VTODO
| UID: TODO-9832a245-f98b-43a4-bf1a-e2f5ccbc1df2
| DTSTART:20120819T080800
| SUMMARY:Weekend with the lads
| CATEGORIES:test
| SEQUENCE:1
| PRIORITY:5
| STATUS:NEEDS-ACTION
| END:VTODO
| END:VCALENDAR
`----

> See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668496
>
>
> Emacs  : GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
>  of 2012-04-07 on trouble, modified by Debian
> Package: Org-mode version 7.8.11
>
> current state:
> ==============
> (setq
>  org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
>  org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
>  org-metaup-hook '(org-babel-load-in-session-maybe)
>  org-after-todo-state-change-hook '(org-clock-out-if-current)
>  org-export-latex-format-toc-function 'org-export-latex-format-toc-default
>  org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe
> 		      org-babel-hide-result-toggle-maybe)
>  org-src-mode-hook '(org-src-babel-configure-edit-buffer
> 		     org-src-mode-configure-edit-buffer)
>  org-confirm-shell-link-function 'yes-or-no-p
>  org-export-first-hook '(org-beamer-initialize-open-trackers)
>  org-agenda-before-write-hook '(org-agenda-add-entry-text)
>  org-babel-pre-tangle-hook '(save-buffer)
>  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
> 		  org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
>  org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers)
>  org-mode-hook '(#[nil "\300\301\302\303\304$\207"
> 		   [org-add-hook change-major-mode-hook org-show-block-all append local]
> 		   5]
> 		 #[nil "\300\301\302\303\304$\207"
> 		   [org-add-hook change-major-mode-hook org-babel-show-result-all append
> 		    local]
> 		   5]
> 		 org-babel-result-hide-spec org-babel-hide-all-hashes)
>  org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
>  org-confirm-elisp-link-function 'yes-or-no-p
>  org-export-interblocks '((src org-babel-exp-non-block-elements))
>  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
>  org-occur-hook '(org-first-headline-recenter)
>  org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
>  org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
> 			       org-beamer-auto-fragile-frames
> 			       org-beamer-place-default-actions-for-lists)
>  org-metadown-hook '(org-babel-pop-to-session-maybe)
>  org-export-blocks '((src org-babel-exp-src-block nil)
> 		     (export-comment org-export-blocks-format-comment t)
> 		     (ditaa org-export-blocks-format-ditaa nil)
> 		     (dot org-export-blocks-format-dot nil))
>  )

-- 
 Bastien

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

* Re: Bug: icalendar export skips todos with a scheduled time-range [7.8.11]
  2012-08-17 12:36 Bug: icalendar export skips todos with a scheduled time-range [7.8.11] Friedrich Delgado
  2012-08-19  6:09 ` Bastien
@ 2012-08-19  6:15 ` Bastien
  2012-08-20  9:21   ` Friedrich Delgado
  1 sibling, 1 reply; 7+ messages in thread
From: Bastien @ 2012-08-19  6:15 UTC (permalink / raw)
  To: Friedrich Delgado; +Cc: emacs-orgmode

Hi Friedrich,

Friedrich Delgado <friedel@nomaden.org> writes:

> If I have an org-file containing a todo with a scheduled date range, like
> this:
>
> ,----[ foo.org ]
>   *** TODO Weekend with the lads
>       SCHEDULED: <2012-05-04 Fr>--<2012-05-08 Di>
> `----
>
> and try to export it via org-export-icalendar-this-file, the resulting
> foo.ics will look like this

With emacs -Q and latest Org, I get this:

  BEGIN:VCALENDAR
  VERSION:2.0
  X-WR-CALNAME:test
  PRODID:-//Bastien Guerry//Emacs with Org-mode//EN
  X-WR-TIMEZONE:CEST
  X-WR-CALDESC:nil
  CALSCALE:GREGORIAN
  BEGIN:VEVENT
  UID: TS-f16e36f0-7c1a-4690-b705-0aaa74d5835c
  DTSTART;VALUE=DATE:20120504
  DTEND;VALUE=DATE:20120509
  SUMMARY:TODO Weekend with the lads
  CATEGORIES:test
  END:VEVENT
  END:VCALENDAR

Can you clone the git repo and let me know if you get the same?

Thanks,

-- 
 Bastien

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

* Re: Bug: icalendar export skips todos with a scheduled time-range [7.8.11]
  2012-08-19  6:15 ` Bastien
@ 2012-08-20  9:21   ` Friedrich Delgado
  2012-08-20 11:13     ` Friedrich Delgado
  0 siblings, 1 reply; 7+ messages in thread
From: Friedrich Delgado @ 2012-08-20  9:21 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

confirmed, latest org does the right thing[TM]

Bastien schrieb:
> Hi Friedrich,
>
> Friedrich Delgado <friedel@nomaden.org> writes:
>
> > If I have an org-file containing a todo with a scheduled date range, like
> > this:
> >
> > ,----[ foo.org ]
> >   *** TODO Weekend with the lads
> >       SCHEDULED: <2012-05-04 Fr>--<2012-05-08 Di>
> > `----
> >
> > and try to export it via org-export-icalendar-this-file, the resulting
> > foo.ics will look like this
>
> With emacs -Q and latest Org, I get this:
>
>   BEGIN:VCALENDAR
>   VERSION:2.0
>   X-WR-CALNAME:test
>   PRODID:-//Bastien Guerry//Emacs with Org-mode//EN
>   X-WR-TIMEZONE:CEST
>   X-WR-CALDESC:nil
>   CALSCALE:GREGORIAN
>   BEGIN:VEVENT
>   UID: TS-f16e36f0-7c1a-4690-b705-0aaa74d5835c
>   DTSTART;VALUE=DATE:20120504
>   DTEND;VALUE=DATE:20120509
>   SUMMARY:TODO Weekend with the lads
>   CATEGORIES:test
>   END:VEVENT
>   END:VCALENDAR
>
> Can you clone the git repo and let me know if you get the same?
>
> Thanks,
>
> --
>  Bastien
---Zitatende---

--
        Friedrich Delgado <friedel@nomaden.org>
                             TauPan on Ircnet and Freenode ;)

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

* Re: Bug: icalendar export skips todos with a scheduled time-range [7.8.11]
  2012-08-20  9:21   ` Friedrich Delgado
@ 2012-08-20 11:13     ` Friedrich Delgado
  2012-08-22  0:41       ` Bastien
  2012-08-24 14:16       ` Friedrich Delgado
  0 siblings, 2 replies; 7+ messages in thread
From: Friedrich Delgado @ 2012-08-20 11:13 UTC (permalink / raw)
  To: Bastien, emacs-orgmode; +Cc: 668496-quiet

Friedrich Delgado schrieb:
> confirmed, latest org does the right thing[TM]

However: If I (setq org-icalendar-use-plain-timestamp nil) as in my
customisation, scheduled date-ranges are not exported at all (no
matter what org-icalendar-use-scheduled is set to).

( 49905a566970541de76b6d49004c62e50c625a98 from this morning)

> Bastien schrieb:
> > Hi Friedrich,
> > Friedrich Delgado <friedel@nomaden.org> writes:
> >
> > > If I have an org-file containing a todo with a scheduled date range, like
> > > this:
> > >
> > > ,----[ foo.org ]
> > >   *** TODO Weekend with the lads
> > >       SCHEDULED: <2012-05-04 Fr>--<2012-05-08 Di>
> > > `----
> > >
> > > and try to export it via org-export-icalendar-this-file, the resulting
> > > foo.ics will look like this
> >
> > With emacs -Q and latest Org, I get this:
> >
> >   BEGIN:VCALENDAR
> >   VERSION:2.0
> >   X-WR-CALNAME:test
> >   PRODID:-//Bastien Guerry//Emacs with Org-mode//EN
> >   X-WR-TIMEZONE:CEST
> >   X-WR-CALDESC:nil
> >   CALSCALE:GREGORIAN
> >   BEGIN:VEVENT
> >   UID: TS-f16e36f0-7c1a-4690-b705-0aaa74d5835c
> >   DTSTART;VALUE=DATE:20120504
> >   DTEND;VALUE=DATE:20120509
> >   SUMMARY:TODO Weekend with the lads
> >   CATEGORIES:test
> >   END:VEVENT
> >   END:VCALENDAR
> >
> > Can you clone the git repo and let me know if you get the same?

--
        Friedrich Delgado <friedel@nomaden.org>
                             TauPan on Ircnet and Freenode ;)

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

* Re: Bug: icalendar export skips todos with a scheduled time-range [7.8.11]
  2012-08-20 11:13     ` Friedrich Delgado
@ 2012-08-22  0:41       ` Bastien
  2012-08-24 14:16       ` Friedrich Delgado
  1 sibling, 0 replies; 7+ messages in thread
From: Bastien @ 2012-08-22  0:41 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: 668496-quiet

Hi Friedrich,

Friedrich Delgado <friedel@nomaden.org> writes:

> Friedrich Delgado schrieb:
>> confirmed, latest org does the right thing[TM]
>
> However: If I (setq org-icalendar-use-plain-timestamp nil) as in my
> customisation, scheduled date-ranges are not exported at all (no
> matter what org-icalendar-use-scheduled is set to).

This should be fixed now, let me know.  

Thanks,

-- 
 Bastien

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

* Re: Bug: icalendar export skips todos with a scheduled time-range [7.8.11]
  2012-08-20 11:13     ` Friedrich Delgado
  2012-08-22  0:41       ` Bastien
@ 2012-08-24 14:16       ` Friedrich Delgado
  1 sibling, 0 replies; 7+ messages in thread
From: Friedrich Delgado @ 2012-08-24 14:16 UTC (permalink / raw)
  To: Bastien, emacs-orgmode, 668496

This is now also fixed, thanks!

Friedrich Delgado schrieb:
> However: If I (setq org-icalendar-use-plain-timestamp nil) as in my
> customisation, scheduled date-ranges are not exported at all (no
> matter what org-icalendar-use-scheduled is set to).
>
> ( 49905a566970541de76b6d49004c62e50c625a98 from this morning)

--
        Friedrich Delgado <friedel@nomaden.org>
                             TauPan on Ircnet and Freenode ;)

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

end of thread, other threads:[~2012-08-24 14:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17 12:36 Bug: icalendar export skips todos with a scheduled time-range [7.8.11] Friedrich Delgado
2012-08-19  6:09 ` Bastien
2012-08-19  6:15 ` Bastien
2012-08-20  9:21   ` Friedrich Delgado
2012-08-20 11:13     ` Friedrich Delgado
2012-08-22  0:41       ` Bastien
2012-08-24 14:16       ` Friedrich Delgado

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).