From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
To: emacs-orgmode@gnu.org
Subject: Bug: Preserve text-properties of cells when moving column in org-table
Date: Sun, 12 Feb 2017 12:41:19 +0100 [thread overview]
Message-ID: <20170212114119.GA7073@seven> (raw)
Hello,
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.
The patch is as follows (based on)
commit 1aeb958e5660879ccd865e8147117db50251eda7
Commit: Marco Wahl <marcowahlsoft@gmail.com>
CommitDate: Sun Feb 12 09:19:06 2017 +0100
From 0a60d9857cede915d9c025ab2bab7e7d95d583b4 Mon Sep 17 00:00:00 2001
From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
Date: Wed, 14 Dec 2016 21:47:48 +0100
Subject: [PATCH] + org-table: move table column with leaving text-properties
untouched.
MINOR-PATCH
---
lisp/org-table.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/org-table.el b/lisp/org-table.el
index b7a49f3..d94e42e 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1486,7 +1486,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)
--
2.9.0.137.gcf4c2cf
With kind regards,
Stefan
--
Stefan-W. Hahn It is easy to make things.
It is hard to make things simple.
next reply other threads:[~2017-02-12 11:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-12 11:41 Stefan-W. Hahn [this message]
2017-02-13 14:39 ` Bug: Preserve text-properties of cells when moving column in org-table Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170212114119.GA7073@seven \
--to=stefan.hahn@s-hahn.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).