From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ruy Exel Subject: Re: Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't Date: Sat, 18 Nov 2017 23:16:20 -0200 Message-ID: References: <874lprp38r.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c0caa20196208055e4bba84" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGEEK-0001TJ-Hh for emacs-orgmode@gnu.org; Sat, 18 Nov 2017 20:17:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGEEJ-0002vB-1X for emacs-orgmode@gnu.org; Sat, 18 Nov 2017 20:17:04 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:33628) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGEEI-0002um-MK for emacs-orgmode@gnu.org; Sat, 18 Nov 2017 20:17:02 -0500 Received: by mail-wm0-x22e.google.com with SMTP id g130so2317298wme.0 for ; Sat, 18 Nov 2017 17:17:02 -0800 (PST) In-Reply-To: <874lprp38r.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org --94eb2c0caa20196208055e4bba84 Content-Type: text/plain; charset="UTF-8" Hi Nicolas, This is indeed a good idea as it mimics the creation of a row in emacs text-mode with "C-o". Best wishes, Ruy On Sat, Nov 18, 2017 at 9:37 PM, Nicolas Goaziou wrote: > Hello, > > Ruy Exel writes: > > > 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). > > The deletion is triggered by pressing the arrow. Your suggestion > would make the point move right. This is not optimal either. > > Maybe the other way is better. Since column creation is triggered by > pressing arrow, we might create it to the right of the current > column, and point would move into it. > > WDYT? > > Regards, > > -- > Nicolas Goaziou > On Sat, Nov 18, 2017 at 9:37 PM, Nicolas Goaziou wrote: > Hello, > > Ruy Exel writes: > > > 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). > > The deletion is triggered by pressing the arrow. Your suggestion > would make the point move right. This is not optimal either. > > Maybe the other way is better. Since column creation is triggered by > pressing arrow, we might create it to the right of the current > column, and point would move into it. > > WDYT? > > Regards, > > -- > Nicolas Goaziou > --94eb2c0caa20196208055e4bba84 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Nicolas,

T= his is indeed a good idea as it mimics the creation of a row in emacs text-= mode with "C-o".=C2=A0

B= est wishes,
Ruy

On Sat, Nov 18, 2017 at 9:37 PM, Nicolas Goaziou <m= ail@nicolasgoaziou.fr> wrote:
Hello,

Ruy Exel <ruyexel@gmail.com>= writes:

> 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 colu= mns pressing
> 'M-S-right' each time and, immediately after that, delete two = columns with
> "M-S-left".=C2=A0 One would expect the table to return to it= s original state,
> but is doesn't.=C2=A0 In reality 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 deletion actually kills the column labeled "Na= me".
>
> Contrast this with the behaviour of inserting and deleting characters = in
> text-mode and you will see that the above behaviour is counter intuiti= ve.
>
> I believe this is due to the fact that 'M-S-right' inserts a c= olumn 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 delete= d
> 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).
The deletion is triggered by pressing the <LEFT> arrow. Y= our suggestion
would make the point move right. This is not optimal either.

Maybe the other way is better. Since column creation is triggered by
pressing <RIGHT> arrow, we might create it to the right of the curren= t
column, and point would move into it.

WDYT?

Regards,

--
Nicolas Goaziou


<= /div>

On Sat, Nov = 18, 2017 at 9:37 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr><= /span> wrote:
Hello,

Ruy Exel <ruyexel@gmail.com>= writes:

> 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 colu= mns pressing
> 'M-S-right' each time and, immediately after that, delete two = columns with
> "M-S-left".=C2=A0 One would expect the table to return to it= s original state,
> but is doesn't.=C2=A0 In reality 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 deletion actually kills the column labeled "Na= me".
>
> Contrast this with the behaviour of inserting and deleting characters = in
> text-mode and you will see that the above behaviour is counter intuiti= ve.
>
> I believe this is due to the fact that 'M-S-right' inserts a c= olumn 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 delete= d
> 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).
The deletion is triggered by pressing the <LEFT> arrow. Y= our suggestion
would make the point move right. This is not optimal either.

Maybe the other way is better. Since column creation is triggered by
pressing <RIGHT> arrow, we might create it to the right of the curren= t
column, and point would move into it.

WDYT?

Regards,

--
Nicolas Goaziou

--94eb2c0caa20196208055e4bba84--