* [RFC] Preserving text-properties when moving columns in org-table
@ 2016-12-06 20:05 Stefan-W. Hahn
0 siblings, 0 replies; only message in thread
From: Stefan-W. Hahn @ 2016-12-06 20:05 UTC (permalink / raw)
To: emacs-orgmode
Hello,
I'm using text-properties to mark special entries on org-tables.
When moving columns around in such a propertized table, the text-properties
got lost because moving around is realized with "replace-match", which does
not save the text-properties.
If replacing "replace-match" with "transpose-regions" the text-properties
of the text will be preserved.
The only thing I'm not sure about is if leaving markers, parameter
"leave-markers" of transpose-regions should be set.
#+BEGIN_SRC
modified lisp/org-table.el
@@ -1494,7 +1494,9 @@ org-table-move-column
(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)
#+END_SRC
Moving rows with org-table-move-row preserves the text-properties and is
therefore ok.
With kind regards,
Stefan
--
Stefan-W. Hahn It is easy to make things.
It is hard to make things simple.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-12-06 20:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 20:05 [RFC] Preserving text-properties when moving columns in org-table Stefan-W. Hahn
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.