summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan-W. Hahn <stefan.hahn@s-hahn.de>2017-02-12 12:41:19 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-02-13 15:37:53 +0100
commitfe97948e89b17a430d993cb732c240b3b7785ae7 (patch)
treec6f7fef1e8ef432bc3ad92b0811677d9fd0c7939
parentb5b44f918dc66af95f5f7d0f9c9f1cddfb1a73cc (diff)
downloadorg-mode-fe97948e89b17a430d993cb732c240b3b7785ae7.tar.gz
org-table: Move table column with leaving text-properties untouched
* lisp/org-table.el (org-table-move-column): Use `transpose-regions'. Moving org-table rows is implemented with delete-region and insert which preserve text-properties. Moving org-table columns is implemented with replace-string, which removes text-properties. My proposal is to use transpose-regions in org-table-move-column which will preserve text-properties when moving columns in org-tables.
-rw-r--r--lisp/org-table.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index f6d43d3..c055fb7 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1494,7 +1494,9 @@ non-nil, the one above is used."
(unless (org-at-table-hline-p)
(org-table-goto-column col1 t)
(when (looking-at "|\\([^|\n]+\\)|\\([^|\n]+\\)|")
- (replace-match "|\\2|\\1|")))
+ (transpose-regions
+ (match-beginning 1) (match-end 1)
+ (match-beginning 2) (match-end 2))))
(forward-line)))
(set-marker end nil)
(org-table-goto-column colpos)