summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2010-06-30 16:01:38 -0700
committerEric Schulte <schulte.eric@gmail.com>2010-06-30 16:01:38 -0700
commitf44832eed05dd42f6d4ea16e231f7570ae08e8bd (patch)
treed89466d24a71d7994aab10aa80ba11afd37c2df8
parent011553652e2be62714886885233b9a2a7bac3ff9 (diff)
downloadorg-mode-f44832eed05dd42f6d4ea16e231f7570ae08e8bd.tar.gz
org-exp: now removing table meta (e.g. #+TBLNAME, #+TBLFM) from export
* lisp/org-exp.el (org-export-handle-table-metalines): this function removes table specific meta-lines, now that we aren't wiping everything that looks remotely like a comment at the end of the export process we have to be sure to catch all of the specific lines in org-exp.el
-rw-r--r--lisp/org-exp.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index d7a9e19..5a7328c 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1161,6 +1161,9 @@ on this string to produce the exported version."
;; Remove or replace comments
(org-export-handle-comments (plist-get parameters :comments))
+ ;; Remove #+TBLFM and #+TBLNAME lines
+ (org-export-handle-table-metalines)
+
;; Run the final hook
(run-hooks 'org-export-preprocess-final-hook)
@@ -1671,6 +1674,19 @@ When it is nil, all comments will be removed."
(replace-match "")
(goto-char (max (point-min) (1- pos))))))))
+(defun org-export-handle-table-metalines ()
+ "Remove table specific metalines #+TBLNAME: and #+TBLFM:."
+ (let ((re "^[ \t]*#\\+TBL\\(NAME\\|FM\\):\\(.*\n?\\)")
+ pos)
+ (goto-char (point-min))
+ (while (or (looking-at re)
+ (re-search-forward re nil t))
+ (setq pos (match-beginning 0))
+ (if (get-text-property (point) 'org-protected)
+ (goto-char (1+ pos))
+ (goto-char (1+ pos))
+ (replace-match "")
+ (goto-char (max (point-min) (1- pos)))))))
(defun org-export-mark-radio-links ()
"Find all matches for radio targets and turn them into internal links."