;;; org-icalendar.el --- iCalendar export for Org-mode
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.29c
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:group 'org-export-icalendar
:type 'string)
+(defcustom org-icalendar-use-plain-timestamp t
+ "Non-nil means make an event from every plain time stamp."
+ :group 'org-export-icalendar
+ :type 'boolean)
+
(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
"Contexts where iCalendar export should use a deadline time stamp.
This is a list with several symbols in it. Valid symbol are:
(const :tag "All tags, including inherited ones" all-tags))))
(defcustom org-icalendar-include-todo nil
- "Non-nil means, export to iCalendar files should also cover TODO items.
+ "Non-nil means export to iCalendar files should also cover TODO items.
Valid values are:
-nil don't inlcude any TODO items
+nil don't include any TODO items
t include all TODO items that are not in a DONE state
-unblocked include all TODO idems that are not blocked
+unblocked include all TODO items that are not blocked
all include both done and not done items."
:group 'org-export-icalendar
:type '(choice
(const :tag "Unblocked" unblocked)
(const :tag "All" all)))
+(defvar org-icalendar-verify-function nil
+ "Function to verify entries for iCalendar export.
+This can be set to a function that will be called at each entry that
+is considered for export to iCalendar. When the function returns nil,
+the entry will be skipped. When it returns a non-nil value, the entry
+will be considered for export.
+This is used internally when an agenda buffer is exported to an ics file,
+to make sure that only entries currently listed in the agenda will end
+up in the ics file. But for normal iCalendar export, you can use this
+for whatever you need.")
+
(defcustom org-icalendar-include-bbdb-anniversaries nil
- "Non-nil means, a combined iCalendar files should include anniversaries.
+ "Non-nil means a combined iCalendar files should include anniversaries.
The anniversaries are define in the BBDB database."
:group 'org-export-icalendar
:type 'boolean)
(defcustom org-icalendar-include-sexps t
- "Non-nil means, export to iCalendar files should also cover sexp entries.
+ "Non-nil means export to iCalendar files should also cover sexp entries.
These are entries like in the diary, but directly in an Org-mode file."
:group 'org-export-icalendar
:type 'boolean)
(integer :tag "Max characters")))
(defcustom org-icalendar-store-UID nil
- "Non-nil means, store any created UIDs in properties.
+ "Non-nil means store any created UIDs in properties.
The iCalendar standard requires that all entries have a unique identifier.
Org will create these identifiers as needed. When this variable is non-nil,
the created UIDs will be stored in the ID property of the entry. Then the
(while (re-search-forward re1 nil t)
(catch :skip
(org-agenda-skip)
- (when (boundp 'org-icalendar-verify-function)
- (unless (funcall org-icalendar-verify-function)
+ (when org-icalendar-verify-function
+ (unless (save-match-data (funcall org-icalendar-verify-function))
(outline-next-heading)
(backward-char 1)
(throw :skip nil)))
todo (org-get-todo-state)
;; donep (org-entry-is-done-p)
))
+ (when (and (not org-icalendar-use-plain-timestamp)
+ (not deadlinep) (not scheduledp))
+ (throw :skip t))
(when (and
deadlinep
(if todo
(while (re-search-forward "^&?%%(" nil t)
(catch :skip
(org-agenda-skip)
+ (when org-icalendar-verify-function
+ (unless (save-match-data (funcall org-icalendar-verify-function))
+ (outline-next-heading)
+ (backward-char 1)
+ (throw :skip nil)))
(setq b (match-beginning 0))
(goto-char (1- (match-end 0)))
(forward-sexp 1)
(while (re-search-forward org-todo-line-regexp nil t)
(catch :skip
(org-agenda-skip)
- (when (boundp 'org-icalendar-verify-function)
+ (when org-icalendar-verify-function
(unless (save-match-data
(funcall org-icalendar-verify-function))
(outline-next-heading)
(provide 'org-icalendar)
;; arch-tag: 2dee2b6e-9211-4aee-8a47-a3c7e5bc30cf
-
;;; org-icalendar.el ends here