New custom variable `org-icalendar-honor-noexport-tag'.

* org-icalendar.el (org-icalendar-honor-noexport-tag): New
custom variable.
(org-print-icalendar-entries): Use this new variable to
prevent export of entries with a :noexport: tag.

This was requested by Juraj Kubelka.
This commit is contained in:
Bastien Guerry 2011-02-11 12:03:26 +01:00
parent 3411a9d759
commit 6f29af3440
1 changed files with 11 additions and 1 deletions

View File

@ -73,6 +73,11 @@ for timed events. If non-zero, alarms are created.
:group 'org-export-icalendar :group 'org-export-icalendar
:type 'boolean) :type 'boolean)
(defcustom org-icalendar-honor-noexport-tag nil
"Non-nil means don't export entries with a :noexport: tag."
:group 'org-export-icalendar
:type 'boolean)
(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due) (defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
"Contexts where iCalendar export should use a deadline time stamp. "Contexts where iCalendar export should use a deadline time stamp.
This is a list with several symbols in it. Valid symbol are: This is a list with several symbols in it. Valid symbol are:
@ -299,7 +304,7 @@ When COMBINE is non nil, add the category to each line."
(format-time-string (cdr org-time-stamp-formats) (current-time)) (format-time-string (cdr org-time-stamp-formats) (current-time))
"DTSTART")) "DTSTART"))
hd ts ts2 state status (inc t) pos b sexp rrule hd ts ts2 state status (inc t) pos b sexp rrule
scheduledp deadlinep todo prefix due start scheduledp deadlinep todo prefix due start tags
tmp pri categories location summary desc uid alarm tmp pri categories location summary desc uid alarm
(sexp-buffer (get-buffer-create "*ical-tmp*"))) (sexp-buffer (get-buffer-create "*ical-tmp*")))
(org-refresh-category-properties) (org-refresh-category-properties)
@ -315,6 +320,7 @@ When COMBINE is non nil, add the category to each line."
(throw :skip nil))) (throw :skip nil)))
(setq pos (match-beginning 0) (setq pos (match-beginning 0)
ts (match-string 0) ts (match-string 0)
tags (org-get-tags-at)
inc t inc t
hd (condition-case nil hd (condition-case nil
(org-icalendar-cleanup-string (org-icalendar-cleanup-string
@ -355,6 +361,10 @@ When COMBINE is non nil, add the category to each line."
(when (and (not org-icalendar-use-plain-timestamp) (when (and (not org-icalendar-use-plain-timestamp)
(not deadlinep) (not scheduledp)) (not deadlinep) (not scheduledp))
(throw :skip t)) (throw :skip t))
;; don't export entries with a :noexport: tag
(when (and t org-icalendar-honor-noexport-tag
(member "noexport" tags))
(throw :skip t))
(when (and (when (and
deadlinep deadlinep
(if todo (if todo