Browse Source

iCalendar export: Fix problem with match data.

Harri Kiiskinen writes:

> There is an elusive bug in the ICal export functions. To
> demonstrate it, open this file, allow for the use of the local
> variable, and run 'org-export-icalendar-this-file'. What I get is
> the message "Wrong type argument: stringp, nil"
>
> -----------------------------
> #+FILETAGS: test
> * TODO header
>
> # Local Variables:
> # org-use-tag-inheritance: "^[t]"
> # End:
> -----------------------------
>
> Now, the funny thing is, that if you change the filetag from
> "test" to "est", close the file, and open it again, the file will
> be exported fine! It seems, that if the filetag does match the
> regular expression in org-use-tag-inheritance, then the result is
> error.

This bug was due to a missing save-match-data around a call to
org-get-tags-at.  However, when studying this bug it turned out
that explicitly checking for the archive tag is not needed,
because we already have a call to `org-agenda-skip' in the same
loop.
Carsten Dominik 16 years ago
parent
commit
0c29415de8
2 changed files with 7 additions and 4 deletions
  1. 6 0
      lisp/ChangeLog
  2. 1 4
      lisp/org-icalendar.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2009-05-16  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-icalendar.el (org-print-icalendar-entries): Don't check for
+	archive tag, this is already done by `org-agenda-skip'.
+	data while constructing lost of tags.
+
 2009-05-15  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-05-15  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
 	* org-exp.el (org-export-preprocess-apply-macros): Use semicolon
 	* org-exp.el (org-export-preprocess-apply-macros): Use semicolon

+ 1 - 4
lisp/org-icalendar.el

@@ -401,10 +401,7 @@ END:VEVENT\n"
 					   :to 'done))))))
 					   :to 'done))))))
 			((eq org-icalendar-include-todo t)
 			((eq org-icalendar-include-todo t)
 			 ;; include everything that is not done
 			 ;; include everything that is not done
-			 (member state org-not-done-keywords)))
-		       ;; but make sure this is not an archived entry
-		       (not (member org-archive-tag (org-get-tags-at)))
-		       )
+			 (member state org-not-done-keywords))))
 	      (setq hd (match-string 3)
 	      (setq hd (match-string 3)
 		    summary (org-icalendar-cleanup-string
 		    summary (org-icalendar-cleanup-string
 			     (org-entry-get nil "SUMMARY"))
 			     (org-entry-get nil "SUMMARY"))