summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-12-04 17:00:46 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2011-12-04 17:01:19 +0100
commit7e49b85c56bc5c71bc44dde2f62a9931698184f9 (patch)
tree6fbd1f02099e10b555d7b6eeaab77d532835bfcb
parent3aaa5203fd6cd7ee1fec30f828ee26699cd09486 (diff)
downloadorg-mode-7e49b85c56bc5c71bc44dde2f62a9931698184f9.tar.gz
org-export: Cleanup #+name and #+results
* lisp/org-exp.el (org-export-res/src-name-cleanup): Remove #+name and #+results lines during preprocess. Now Babel doesn't handle anymore those keywords cleanup (as #+name may be used for other thing than code evaluation), that task is moved to org-export.el. See commit 25a0a0212193ecc5e910696301b3a64a51f837e0.
-rw-r--r--lisp/org-exp.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 69f0280..c55d566 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1283,6 +1283,9 @@ on this string to produce the exported version."
;; Remove #+TBLFM and #+TBLNAME lines
(org-export-handle-table-metalines)
+ ;; Remove #+results and #+name lines
+ (org-export-res/src-name-cleanup)
+
;; Run the final hook
(run-hooks 'org-export-preprocess-final-hook)
@@ -1992,6 +1995,18 @@ When it is nil, all comments will be removed."
(replace-match "")
(goto-char (max (point-min) (1- pos)))))))
+(defun org-export-res/src-name-cleanup ()
+ "Clean up #+results and #+name lines for export.
+This function should only be called after all block processing
+has taken place."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (let ((case-fold-search t))
+ (while (org-re-search-forward-unprotected
+ "#\\+\\(name\\|results\\(\\[[a-z0-9]+\\]\\)?\\):" nil t)
+ (delete-region (match-beginning 0) (progn (forward-line) (point)))))))
+
(defun org-export-mark-radio-links ()
"Find all matches for radio targets and turn them into internal links."
(let ((re-radio (and org-target-link-regexp