Просмотр исходного кода

Re-introduce the variable `org-inlinetask-export'

Carsten Dominik 15 лет назад
Родитель
Сommit
cc0a819186
2 измененных файлов с 38 добавлено и 24 удалено
  1. 7 0
      lisp/ChangeLog
  2. 31 24
      lisp/org-inlinetask.el

+ 7 - 0
lisp/ChangeLog

@@ -1,3 +1,10 @@
+2009-10-12  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-inlinetask.el (org-inlinetask-export): Re-introduce
+	variable.
+	(org-inlinetask-export-handler): Only export inline task if the
+	user option calls for it.
+
 2009-10-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-exp.el (org-export-handle-export-tags): Remove inlinetask

+ 31 - 24
lisp/org-inlinetask.el

@@ -93,6 +93,12 @@ the value of this variable."
   :group 'org-inlinetask
   :type 'boolean)
 
+(defcustom org-inlinetask-export nil
+  "Non-nil means, export inline tasts.
+When nil, they will not be exported."
+  :group 'org-inlinetask
+  :type 'boolean)
+
 (defvar org-odd-levels-only)
 (defvar org-keyword-time-regexp)
 (defvar org-drawer-regexp)
@@ -139,30 +145,31 @@ Either remove headline and meta data, or do special formatting."
 	(setq content (buffer-substring beg (1- (point-at-bol))))
 	(delete-region beg (1+ (match-end 0))))
       (goto-char beg)
-      (when (string-match org-complex-heading-regexp headline)
-	(setq headline (concat
-			(if (match-end 2)
-			    (concat (match-string 2 headline) " ") "")
-			(match-string 4 headline)))
-	(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 (make-string (org-inlinetask-get-current-indentation) ?\ )
-		"- ")
-	(setq indent (make-string (current-column) ?\ ))
-	(insert headline " ::")
-	(if content
-	    (insert (if htmlp " " (concat "\n" indent))
-		    (mapconcat 'identity (org-split-string content "\n")
-			       (concat "\n" indent)) "\n")
-	  (insert "\n"))
-	(insert indent)
-	(backward-delete-char 2)
-	(insert "THISISTHEINLINELISTTEMINATOR\n")))))
+      (when org-inlinetask-export
+	(when (string-match org-complex-heading-regexp headline)
+	  (setq headline (concat
+			  (if (match-end 2)
+			      (concat (match-string 2 headline) " ") "")
+			  (match-string 4 headline)))
+	  (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 (make-string (org-inlinetask-get-current-indentation) ?\ )
+		  "- ")
+	  (setq indent (make-string (current-column) ?\ ))
+	  (insert headline " ::")
+	  (if content
+	      (insert (if htmlp " " (concat "\n" indent))
+		      (mapconcat 'identity (org-split-string content "\n")
+				 (concat "\n" indent)) "\n")
+	    (insert "\n"))
+	  (insert indent)
+	  (backward-delete-char 2)
+	  (insert "THISISTHEINLINELISTTEMINATOR\n"))))))
 
 (defun org-inlinetask-get-current-indentation ()
   "Get the indentation of the last non-while line above this one."