From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Stefan-W. Hahn" Subject: Bug: Preserve text-properties of cells when moving column in org-table Date: Sun, 12 Feb 2017 12:41:19 +0100 Message-ID: <20170212114119.GA7073@seven> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccsX1-0003Is-Px for emacs-orgmode@gnu.org; Sun, 12 Feb 2017 06:41:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccsWy-0003v0-Nk for emacs-orgmode@gnu.org; Sun, 12 Feb 2017 06:41:27 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:60039) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ccsWy-0003us-Dp for emacs-orgmode@gnu.org; Sun, 12 Feb 2017 06:41:24 -0500 Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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 CommitDate: Sun Feb 12 09:19:06 2017 +0100 =46rom 0a60d9857cede915d9c025ab2bab7e7d95d583b4 Mon Sep 17 00:00:00 2001 =46rom: "Stefan-W. Hahn" 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) --=20 2.9.0.137.gcf4c2cf With kind regards, Stefan --=20 Stefan-W. Hahn It is easy to make things. It is hard to make things simple.