From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viktor Rosenfeld Subject: [PATCH] ox-icalendar: fix handling of timestamps Date: Sun, 11 Aug 2013 04:03:59 +0200 Message-ID: <20130811020358.GA30350@kenny.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8L0z-0003i8-BK for emacs-orgmode@gnu.org; Sat, 10 Aug 2013 22:04:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8L0n-0001R0-JB for emacs-orgmode@gnu.org; Sat, 10 Aug 2013 22:04:17 -0400 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:61909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8L0n-0001OL-C7 for emacs-orgmode@gnu.org; Sat, 10 Aug 2013 22:04:05 -0400 Received: by mail-ea0-f182.google.com with SMTP id o10so2764312eaj.13 for ; Sat, 10 Aug 2013 19:04:04 -0700 (PDT) Received: from kenny.local (e179175132.adsl.alicedsl.de. [85.179.175.132]) by mx.google.com with ESMTPSA id bn13sm43720615eeb.11.2013.08.10.19.04.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 Aug 2013 19:04:03 -0700 (PDT) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * 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) + (and (eq with-timestamps 'active) + (or (eq type 'active) + (eq type 'active-range))) + (and (eq with-timestamps 'inactive) + (or (eq type 'inactive) + (eq type 'inactive-range)))) + (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. -- 1.8.3.4