From 1819b90931e79c06e88071466aec330ab4963a0c Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 23 Apr 2014 21:31:34 +0200 Subject: [PATCH] ox-icalendar: Use `org-icalendar-with-timestamps' * lisp/ox-icalendar.el (org-icalendar-entry): Use `org-icalendar-with-timestamps'. We cannot simply rely on ignored timestamps in communication channels, as regular `org-export-with-timestamps' only applies to isolated timestamps. Thanks to Greg Troxel for reporting it. http://permalink.gmane.org/gmane.emacs.orgmode/85387 --- lisp/ox-icalendar.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index a60c2f92f..144546ae6 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -570,13 +570,19 @@ inlinetask within the section." ;; happen once ENTRY is one of them. (let ((counter 0)) (mapconcat - 'identity + #'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))) + (when (let ((type (org-element-property :type ts))) + (case (plist-get info :with-timestamps) + (active (memq type '(active active-range))) + (inactive (memq type '(inactive inactive-range))) + ((t) t))) + (let ((uid (format "TS%d-%s" (incf counter) uid))) + (org-icalendar--vevent + entry ts uid summary loc desc cat)))) info nil (and (eq type 'headline) 'inlinetask)) "")) ;; Task: First check if it is appropriate to export it. @@ -589,7 +595,7 @@ inlinetask within the section." (and (eq type 'headline) (not (org-icalendar-blocked-headline-p entry info)))) - ('t (eq todo-type 'todo)))) + ((t) (eq todo-type 'todo)))) (org-icalendar--vtodo entry uid summary loc desc cat)) ;; Diary-sexp: Collect every diary-sexp element within ;; ENTRY and its title, and transcode them. If ENTRY is @@ -597,7 +603,7 @@ inlinetask within the section." ;; separately. (when org-icalendar-include-sexps (let ((counter 0)) - (mapconcat 'identity + (mapconcat #'identity (org-element-map (cons (org-element-property :title entry) (org-element-contents inside)) @@ -613,7 +619,7 @@ inlinetask within the section." ;; inlinetask within it. In agenda export, this is independent ;; from the mark (or lack thereof) on the entry. (when (eq type 'headline) - (mapconcat 'identity + (mapconcat #'identity (org-element-map inside 'inlinetask (lambda (task) (org-icalendar-entry task nil info)) info) ""))