emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] ox-icalendar: fix handling of timestamps


From: Aaron Ecay
Subject: Re: [O] [PATCH] ox-icalendar: fix handling of timestamps
Date: Sat, 10 Aug 2013 22:13:54 -0400
User-agent: Notmuch/0.15.2+171~ge2f30a2 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu)

Hi Viktor,

Thanks for this patch; I had also noticed this problem.

2013ko abuztuak 10an, Viktor Rosenfeld-ek idatzi zuen:
> 
>   * ox-icalendar.el (org-icalendar-entry): Honor setting of
>   `org-icalendar-with-timestamps' for timestamps on headlines
>   and checkboxes.
> 
>   The setting `org-icalendar-with-timestamps' was only applied
>   to timestamps which do not appear on a heading or on a
>   checkbox. E.g., with `org-icalendar-with-timestamps' set to
>   'active, an heading containing an inactive timestamp on would
>   be exported. This patch fixes this.
> 
> TINYCHANGE
> ---
>  lisp/ox-icalendar.el | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
> index c6ab295..8f15124 100644
> --- a/lisp/ox-icalendar.el
> +++ b/lisp/ox-icalendar.el
> @@ -580,15 +580,24 @@ inlinetask within the section."
>       ;; When collecting plain timestamps from a headline and
>       ;; its title, skip inlinetasks since collection will
>       ;; happen once ENTRY is one of them.
> -     (let ((counter 0))
> +     (let ((counter 0)
> +     (with-timestamps (plist-get info :with-timestamps)))
>         (mapconcat
>          'identity
>          (org-element-map (cons (org-element-property :title entry)
>               (org-element-contents inside))
>        'timestamp
>      (lambda (ts)
> -      (let ((uid (format "TS%d-%s" (incf counter) uid)))
> -        (org-icalendar--vevent entry ts uid summary loc desc cat)))
> +      (let ((type (org-element-property :type ts))
> +      (uid (format "TS%d-%s" (incf counter) uid)))
> +        (when (or (eq with-timestamps 'all)

Here, I think you want to compare with t, not 'all (check the defcustom
for ‘org-icalendar-with-timestamps’).

> +            (and (eq with-timestamps 'active)
> +           (or (eq type 'active)
> +         (eq type 'active-range)))

This is only a cosmetic comment, so feel free to disregard it, but:
might the ‘(or ...)’ be cleaner as ‘(memq type '(active active-range))’?

-- 
Aaron Ecay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]