Explorar el Código

iCalendar export: Honor user request to skip plain time stamps

Carsten Dominik hace 15 años
padre
commit
1029daee03
Se han modificado 2 ficheros con 12 adiciones y 0 borrados
  1. 4 0
      lisp/ChangeLog
  2. 8 0
      lisp/org-icalendar.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-10-28  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-icalendar.el (org-icalendar-use-plain-timestamp): New option.
+	(org-print-icalendar-entries): Skip entries where the timestamp is
+	not a deadline and not scheduled, if the user requests that.
+
 	* org-latex.el (org-export-latex-quotation-marks): Allow a bracket
 	before an opening quote.
 

+ 8 - 0
lisp/org-icalendar.el

@@ -47,6 +47,11 @@ The file name should be absolute, the file will be overwritten without warning."
   :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:
@@ -307,6 +312,9 @@ When COMBINE is non nil, add the category to each line."
 		  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