summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-04-23 00:09:35 +0200
committerBastien Guerry <bzg@altern.org>2012-04-23 00:09:35 +0200
commite9dec29bb12fbcfc3674395bb34b104b55a29d0e (patch)
tree1a783ef6aa8d679ef9478922e8426c33c2369273
parent94bc01e77e7acf2db9fe873501e5edee4920a19c (diff)
downloadorg-mode-e9dec29bb12fbcfc3674395bb34b104b55a29d0e.tar.gz
org-table.el: Escape some special characters when sending radio tables.
* org-table.el (orgtbl-send-table): Escape special characters. Introduce a new parameter :no-escape to prevent escaping. * org.texi (Radio tables): Document the :no-escape parameter. Thanks to Alexander Willand for raising this issue.
-rw-r--r--doc/org.texi4
-rw-r--r--lisp/org-table.el4
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/org.texi b/doc/org.texi
index 2bdce91..dfdc5ec 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -15551,6 +15551,10 @@ calculation marks, that column is automatically discarded as well.
Please note that the translator function sees the table @emph{after} the
removal of these columns, the function never knows that there have been
additional columns.
+
+@item :no-escape t
+When non-nil, do not escape special characters @code{&%#_^} when exporting
+the table. The default value is nil.
@end table
@noindent
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 305fd3f..6fff3be 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -4296,11 +4296,15 @@ this table."
(params (plist-get dest :params))
(skip (plist-get params :skip))
(skipcols (plist-get params :skipcols))
+ (no-escape (plist-get params :no-escape))
beg
(lines (org-table-clean-before-export
(nthcdr (or skip 0)
(org-split-string txt "[ \t]*\n[ \t]*"))))
(i0 (if org-table-clean-did-remove-column 2 1))
+ (lines (if no-escape lines
+ (mapcar (lambda(l) (replace-regexp-in-string
+ "\\([&%#_^]\\)" "\\\\\\1{}" l)) lines)))
(table (mapcar
(lambda (x)
(if (string-match org-table-hline-regexp x)