From f44832eed05dd42f6d4ea16e231f7570ae08e8bd Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Wed, 30 Jun 2010 16:01:38 -0700 Subject: [PATCH] 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 --- lisp/org-exp.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index d7a9e1988..5a7328c90 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." -- 2.11.4.GIT