浏览代码

Fix icalendar export bug with verification function.

Carsten Dominik 15 年之前
父节点
当前提交
b49a735533
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 5 0
      lisp/ChangeLog
  2. 6 1
      lisp/org-icalendar.el

+ 5 - 0
lisp/ChangeLog

@@ -1,5 +1,10 @@
 2009-11-05  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-icalendar.el (org-print-icalendar-entries): Save match data
+	around call to verify function.
+	(org-print-icalendar-entries): Add a call to the verification
+	function.
+
 	* org.el (org-speedbar-set-agenda-restriction): Remove unnecessary
 	save-restrivtion' form.
 

+ 6 - 1
lisp/org-icalendar.el

@@ -281,7 +281,7 @@ When COMBINE is non nil, add the category to each line."
 	(catch :skip
 	  (org-agenda-skip)
 	  (when org-icalendar-verify-function
-	    (unless (funcall org-icalendar-verify-function)
+	    (unless (save-match-data (funcall org-icalendar-verify-function))
 	      (outline-next-heading)
 	      (backward-char 1)
 	      (throw :skip nil)))
@@ -387,6 +387,11 @@ END:VEVENT\n"
 	(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)