From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ruy Exel Subject: Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't Date: Sat, 18 Nov 2017 11:38:55 -0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403043e5cbce5a738055e41fb50" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eG3LO-00031S-GH for emacs-orgmode@gnu.org; Sat, 18 Nov 2017 08:39:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eG3LN-0003ZP-HJ for emacs-orgmode@gnu.org; Sat, 18 Nov 2017 08:39:38 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eG3LN-0003WR-A4 for emacs-orgmode@gnu.org; Sat, 18 Nov 2017 08:39:37 -0500 Received: by mail-wm0-x235.google.com with SMTP id v186so11060570wma.2 for ; Sat, 18 Nov 2017 05:39:36 -0800 (PST) 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 --f403043e5cbce5a738055e41fb50 Content-Type: text/plain; charset="UTF-8" Given a simple table such as | Name | Age | |-------+-----| | John | 20 | | Peter | 25 | |-------+-----| place the cursor in the cell containing 'Age', insert two columns pressing 'M-S-right' each time and, immediately after that, delete two columns with "M-S-left". One would expect the table to return to its original state, but is doesn't. In reality the table becomes | | Age | |---+-----| | | 20 | | | 25 | |---+-----| because the second deletion actually kills the column labeled "Name". Contrast this with the behaviour of inserting and deleting characters in text-mode and you will see that the above behaviour is counter intuitive. I believe this is due to the fact that 'M-S-right' inserts a column at the cursor, placing the cursor within the inserted column, while, after deletion, the cursor is placed in the column to the LEFT of the deleted column (except after deleting the leftmost column). A possible solution is to place the column to the RIGHT of the deleted column after deletion (except after deleting the rightmost column). Best wishes, Ruy --f403043e5cbce5a738055e41fb50 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Given a simple table such as

| Name=C2=A0 | Age |
|-------+-----= |
| John=C2=A0 |=C2=A0 20 |
| Peter |=C2=A0 25 |
|-------+-----|

place the cursor in the cell containing 'Age', insert = two columns pressing 'M-S-right' each time and, immediately after t= hat, delete two columns with "M-S-left".=C2=A0 One would expect t= he table to return to its original state, but is doesn't.=C2=A0 In real= ity the table becomes

|=C2=A0=C2=A0 | Age |
|---+-----|
|=C2=A0=C2=A0 |=C2=A0 20 |
|= =C2=A0=C2=A0 |=C2=A0 25 |
|---+-----|

because the second d= eletion actually kills the column labeled "Name".=C2=A0

C= ontrast this with the behaviour of inserting and deleting characters in tex= t-mode and you will see that the above behaviour is counter intuitive.
<= br>I believe this is due to the fact that 'M-S-right' inserts a col= umn at the cursor, placing the cursor within the inserted column, while, af= ter deletion, the cursor is placed in the column to the LEFT of the deleted= column (except after deleting the leftmost column).

A possible solu= tion is to place the column to the RIGHT of the deleted column after deleti= on (except after deleting the rightmost column).

Best wishes,<= br>
Ruy

--f403043e5cbce5a738055e41fb50--