emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't
@ 2017-11-18 13:38 Ruy Exel
  2017-11-18 23:37 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Ruy Exel @ 2017-11-18 13:38 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1407 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't
  2017-11-18 13:38 Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't Ruy Exel
@ 2017-11-18 23:37 ` Nicolas Goaziou
  2017-11-19  1:16   ` Ruy Exel
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2017-11-18 23:37 UTC (permalink / raw)
  To: Ruy Exel; +Cc: emacs-orgmode

Hello,

Ruy Exel <ruyexel@gmail.com> 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 <LEFT> 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 <RIGHT> arrow, we might create it to the right of the current
column, and point would move into it.

WDYT?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't
  2017-11-18 23:37 ` Nicolas Goaziou
@ 2017-11-19  1:16   ` Ruy Exel
  2017-11-21 22:47     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Ruy Exel @ 2017-11-19  1:16 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3528 bytes --]

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 <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Ruy Exel <ruyexel@gmail.com> 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 <LEFT> 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 <RIGHT> 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 <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Ruy Exel <ruyexel@gmail.com> 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 <LEFT> 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 <RIGHT> arrow, we might create it to the right of the current
> column, and point would move into it.
>
> WDYT?
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 5135 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't
  2017-11-19  1:16   ` Ruy Exel
@ 2017-11-21 22:47     ` Nicolas Goaziou
  2017-11-28 20:27       ` Ruy Exel
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2017-11-21 22:47 UTC (permalink / raw)
  To: Ruy Exel; +Cc: emacs-orgmode

Hello,

Ruy Exel <ruyexel@gmail.com> writes:

> This is indeed a good idea as it mimics the creation of a row in emacs
> text-mode with "C-o".

This is now implemented.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't
  2017-11-21 22:47     ` Nicolas Goaziou
@ 2017-11-28 20:27       ` Ruy Exel
  2017-11-28 21:58         ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Ruy Exel @ 2017-11-28 20:27 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hi Nicolas,

With the new implementation, is it possible to insert a column to the
left of the first column?

Best,
Ruy

On Tue, Nov 21, 2017 at 8:47 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Ruy Exel <ruyexel@gmail.com> writes:
>
>> This is indeed a good idea as it mimics the creation of a row in emacs
>> text-mode with "C-o".
>
> This is now implemented.
>
> Regards,
>
> --
> Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't
  2017-11-28 20:27       ` Ruy Exel
@ 2017-11-28 21:58         ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2017-11-28 21:58 UTC (permalink / raw)
  To: Ruy Exel; +Cc: emacs-orgmode

Hello,

Ruy Exel <ruyexel@gmail.com> writes:

> With the new implementation, is it possible to insert a column to the
> left of the first column?

I assume this is done with M-S-<Right> followed with M-<Left>.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-28 21:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-18 13:38 Deletion immediately after insertion should leave org-mode tables unaltered but it doesn't Ruy Exel
2017-11-18 23:37 ` Nicolas Goaziou
2017-11-19  1:16   ` Ruy Exel
2017-11-21 22:47     ` Nicolas Goaziou
2017-11-28 20:27       ` Ruy Exel
2017-11-28 21:58         ` Nicolas Goaziou

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).