Переглянути джерело

Fix inline task export

Tasks without content caused did cause an error.
Carsten Dominik 15 роки тому
батько
коміт
b86c061228
2 змінених файлів з 10 додано та 6 видалено
  1. 3 0
      lisp/ChangeLog
  2. 7 6
      lisp/org-inlinetask.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-10-02  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-inlinetask.el (org-inlinetask-export-handler): fix bug for
+	tasks without content.
+
 	* org-clock.el: Make sure the clock-in target position does not
 	move to a different node by widening the buffer.
 

+ 7 - 6
lisp/org-inlinetask.el

@@ -144,12 +144,13 @@ Either remove headline and meta data, or do special formatting."
 			(if (match-end 2)
 			    (concat (match-string 2 headline) " ") "")
 			(match-string 4 headline)))
-	(if (not (string-match "\\S-" content))
-	    (setq content nil)
-	  (if (string-match "[ \t\n]+\\'" content)
-	      (setq content (substring content 0 (match-beginning 0))))
-	  (setq content (org-remove-indentation content))
-	  (if latexp (setq content (concat "\\quad \\\\\n" content))))
+	(when content
+	  (if (not (string-match "\\S-" content))
+	      (setq content nil)
+	    (if (string-match "[ \t\n]+\\'" content)
+		(setq content (substring content 0 (match-beginning 0))))
+	    (setq content (org-remove-indentation content))
+	    (if latexp (setq content (concat "\\quad \\\\\n" content)))))
 	(insert "- ")
 	(setq indent (make-string (current-column) ?\ ))
 	(insert headline " ::")