emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* M-S-up/down on plain lists containing text (or multilevel lists)
@ 2014-11-02  7:43 James Harkins
  2014-11-02  8:26 ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: James Harkins @ 2014-11-02  7:43 UTC (permalink / raw)
  To: orgmode

In plain lists, if there is indented text underneath a list item, is it considered to "belong to" the list item, or is it just freestanding text?

I'm asking because M-S-up/down doesn't take indented text into account. These commands only move the line marked with a list-item indicator ("-" etc.).

* Heading
  - List item 1
  - List item 2
    Indented text
  - List item 3

Position the point on "List item 2" and hit M-S-down. You'll get this, which seems wrong to me:

* Heading
  - List item 1
    Indented text
  - List item 2
  - List item 3

I expected:

* Heading
  - List item 1
  - List item 3
  - List item 2
    Indented text

My opinion is that this is a bug, but it's also possible that I don't fully understand how org interprets plain lists. It does seem that org has a concept of indented text "belonging to" the list item, because you can use TAB to collapse a list item containing indented text, but you can't use it on a list item followed by non-indented text.

* Heading
  - List item 1: TAB can fold this item
    Indented text
  - List item 2: TAB displays a message in the minibuffer "EMPTY ENTRY"
Non-indented text
  - List item 3

I also see the same bizarre behavior of M-S-up/down if a list item has a sub-list under it.

My org is up-to-date as of 10/15/2014.

hjh

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

* Re: M-S-up/down on plain lists containing text (or multilevel lists)
  2014-11-02  7:43 M-S-up/down on plain lists containing text (or multilevel lists) James Harkins
@ 2014-11-02  8:26 ` Nicolas Goaziou
  2014-11-02  8:44   ` James Harkins
  2014-11-03  9:26   ` James Harkins
  0 siblings, 2 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2014-11-02  8:26 UTC (permalink / raw)
  To: James Harkins; +Cc: orgmode

Hello,

James Harkins <jamshark70@qq.com> writes:

> In plain lists, if there is indented text underneath a list item, is
> it considered to "belong to" the list item, or is it just freestanding
> text?

The former.

> I'm asking because M-S-up/down doesn't take indented text into
> account. These commands only move the line marked with a list-item
> indicator ("-" etc.).
>
> * Heading
>   - List item 1
>   - List item 2
>     Indented text
>   - List item 3
>
> Position the point on "List item 2" and hit M-S-down. You'll get this,
> which seems wrong to me:
>
> * Heading
>   - List item 1
>     Indented text
>   - List item 2
>   - List item 3
>
> I expected:
>
> * Heading
>   - List item 1
>   - List item 3
>   - List item 2
>     Indented text
>
> My opinion is that this is a bug

Actually, it isn't. This is a feature.

Both `M-S-up' and `M-S-down' work line wise and ignore any structure
around point. OTOH, `M-up' and `M-down' should do what you want.


Regards,

-- 
Nicolas Goaziou

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

* Re: M-S-up/down on plain lists containing text (or multilevel lists)
  2014-11-02  8:26 ` Nicolas Goaziou
@ 2014-11-02  8:44   ` James Harkins
  2014-11-03  9:26   ` James Harkins
  1 sibling, 0 replies; 7+ messages in thread
From: James Harkins @ 2014-11-02  8:44 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: orgmode

On November 2, 2014 4:25:53 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Actually, it isn't. This is a feature.
>
> Both `M-S-up' and `M-S-down' work line wise and ignore any structure
> around point. OTOH, `M-up' and `M-down' should do what you want.

Ah, OK... It would be a bug if there were no function to move a list item 
with its contents. Since there is such a function, just on a different key 
binding, no bug. Thanks.

hjh

Sent with AquaMail for Android
http://www.aqua-mail.com

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

* Re: M-S-up/down on plain lists containing text (or multilevel lists)
  2014-11-02  8:26 ` Nicolas Goaziou
  2014-11-02  8:44   ` James Harkins
@ 2014-11-03  9:26   ` James Harkins
  2014-11-03 12:48     ` Nicolas Goaziou
  1 sibling, 1 reply; 7+ messages in thread
From: James Harkins @ 2014-11-03  9:26 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail <at> nicolasgoaziou.fr> writes:

> Both `M-S-up' and `M-S-down' work line wise and ignore any structure
> around point. OTOH, `M-up' and `M-down' should do what you want.

BTW the name of the menu item is misleading. C-h C-k M-S-up:

~~
It is bound to <M-S-up>, <menu-bar> <Org> <Edit Structure> <Move
Subtree Up>, <menu-bar> <Tbl> <Row> <Delete Row>.
~~

This is why I thought that M-S-up/down would work on entry + contents -- I
looked in the Emacs menu and saw "Move Subtree Up," and I didn't think to
check the docstring (which contradicts the name in the menu by saying,
correctly, "Drag the line at point up").

hjh

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

* Re: M-S-up/down on plain lists containing text (or multilevel lists)
  2014-11-03  9:26   ` James Harkins
@ 2014-11-03 12:48     ` Nicolas Goaziou
  2014-11-03 13:32       ` James Harkins
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2014-11-03 12:48 UTC (permalink / raw)
  To: James Harkins; +Cc: emacs-orgmode

James Harkins <jamshark70@qq.com> writes:

> BTW the name of the menu item is misleading. C-h C-k M-S-up:
>
> ~~
> It is bound to <M-S-up>, <menu-bar> <Org> <Edit Structure> <Move
> Subtree Up>, <menu-bar> <Tbl> <Row> <Delete Row>.
> ~~
>
> This is why I thought that M-S-up/down would work on entry + contents -- I
> looked in the Emacs menu and saw "Move Subtree Up," and I didn't think to
> check the docstring (which contradicts the name in the menu by saying,
> correctly, "Drag the line at point up").

What improvement are you suggesting then?


Regards,

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

* Re: M-S-up/down on plain lists containing text (or multilevel lists)
  2014-11-03 12:48     ` Nicolas Goaziou
@ 2014-11-03 13:32       ` James Harkins
  2014-11-03 20:06         ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: James Harkins @ 2014-11-03 13:32 UTC (permalink / raw)
  To: Nicolas Goaziou, emacs-orgmode

At Mon, 03 Nov 2014 13:48:56 +0100,
Nicolas Goaziou wrote:
> James Harkins <jamshark70@qq.com> writes:
> > BTW the name of the menu item is misleading. C-h C-k M-S-up:
> >
> > ~~
> > It is bound to <M-S-up>, <menu-bar> <Org> <Edit Structure> <Move
> > Subtree Up>, <menu-bar> <Tbl> <Row> <Delete Row>.
> 
> What improvement are you suggesting then?

Upon further reflection, I think the best would be to bind org-metaup/down to the "move subtree" menu items, rather than org-shiftmetaup. I'm guessing that this is the more common use case (because moving a whole subtree doesn't destroy the structure of that subtree, while moving a line does), so I think it would make more sense to put the more common case in the menu.

hjh

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

* Re: M-S-up/down on plain lists containing text (or multilevel lists)
  2014-11-03 13:32       ` James Harkins
@ 2014-11-03 20:06         ` Nicolas Goaziou
  0 siblings, 0 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2014-11-03 20:06 UTC (permalink / raw)
  To: James Harkins; +Cc: emacs-orgmode

James Harkins <jamshark70@qq.com> writes:

> Upon further reflection, I think the best would be to bind
> org-metaup/down to the "move subtree" menu items, rather than
> org-shiftmetaup. I'm guessing that this is the more common use case
> (because moving a whole subtree doesn't destroy the structure of that
> subtree, while moving a line does), so I think it would make more
> sense to put the more common case in the menu.

Indeed, that's a bug in the menu. Thank you for reporting it.


Regards,

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

end of thread, other threads:[~2014-11-03 20:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-02  7:43 M-S-up/down on plain lists containing text (or multilevel lists) James Harkins
2014-11-02  8:26 ` Nicolas Goaziou
2014-11-02  8:44   ` James Harkins
2014-11-03  9:26   ` James Harkins
2014-11-03 12:48     ` Nicolas Goaziou
2014-11-03 13:32       ` James Harkins
2014-11-03 20:06         ` 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).