emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)]
@ 2017-11-22  5:00 Nathan Aclander
  2017-12-01 17:28 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Nathan Aclander @ 2017-11-22  5:00 UTC (permalink / raw)
  To: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


When using lists in org like the following:

- - Item 1
  - Sub-item 1
  - Sub-item 1
- - Item 2
- - Item 3

I can shift them left and right using ~org-shiftmetaright~ or
~org-shiftmetaleft~.

This also works on the following list:

- - Item 1
  - This is a very long sub-item that is definitely going to be longer
    than 80 characters.
  - Sub-item 2
- - Item 2
- - Item 3

When my cursor is on the second line ( the line that begins with "This
is a very..." I can move the sub-item left and right as expected.

When my cursor is on the third line ( the line that begins with "than
80..." I get a message saying:

"user-error: This command is active in special context like tables,
headlines or items"

Because this *does* work when my cursor is on the above line, I know org
knows how to handle multi line items. Therefore I think it's a bug that
org doesn't recognize the cursor being inside a list when it is on the second
line of a multi item list.

Hopefully I've explained myself clearly, this is my first time
submitting an org bug report. Thanks for the continuing effort going in
to org. 

Please CC me in responses as I'm not subscribed to this list.

Nathan

Emacs  : GNU Emacs 27.0.50 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2017-11-20
Package: Org mode version 9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)

current state:
==============
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-fontify-whole-heading-line t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-agenda-files '("/home/current_user/.emacs.d/org-gcal-calanders/schedule.org")
 org-startup-folded nil
 org-mode-hook '(highlight-sexp-mode (closure (t) nil (org-bullets-mode 1))
                 #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-block-all append local] 5]
                 #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes turn-on-flyspell)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-fontify-quote-and-verse-blocks t
 org-fontify-done-headline t
 org-occur-hook '(org-first-headline-recenter)
 org-structure-template-alist '(("e" "#+BEGIN_SRC emacs-lisp \n?\n#+END_SRC") ("s" "#+BEGIN_SRC ?\n\n#+END_SRC")
                                ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE") ("q" "#+BEGIN_QUOTE\n?\n#+END_QUOTE")
                                ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE") ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM")
                                ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER") ("C" "#+BEGIN_COMMENT\n?\n#+END_COMMENT")
                                ("l" "#+BEGIN_EXPORT latex\n?\n#+END_EXPORT") ("L" "#+LaTeX: ")
                                ("h" "#+BEGIN_EXPORT html\n?\n#+END_EXPORT") ("H" "#+HTML: ")
                                ("a" "#+BEGIN_EXPORT ascii\n?\n#+END_EXPORT") ("A" "#+ASCII: ") ("i" "#+INDEX: ?")
                                ("I" "#+INCLUDE: %file ?"))
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate)
 org-return-follows-link t
 org-open-non-existing-files t
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("id" :follow org-id-open) ("rmail" :follow org-rmail-open :store org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link)
                       ("info" :follow org-info-open :export org-info-export :store org-info-store-link)
                       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
                       ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
                       ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store
                        org-bbdb-store-link)
                       ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs") ("doi" :follow org--open-doi-link)
                       ("elisp" :follow org--open-elisp-link) ("file" :complete org-file-complete-link)
                       ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path)))) ("help" :follow org--open-help-link)
                       ("http" :follow (lambda (path) (browse-url (concat "http:" path))))
                       ("https" :follow (lambda (path) (browse-url (concat "https:" path))))
                       ("mailto" :follow (lambda (path) (browse-url (concat "mailto:" path))))
                       ("news" :follow (lambda (path) (browse-url (concat "news:" path)))) ("shell" :follow org--open-shell-link))
 org-latex-packages-alist '(("" "minted"))
 org-link-frame-setup '((file . find-file))
 )
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEGeJXVkBwWe7PtHGAT+2Q9qPVLSQFAloVBHEACgkQT+2Q9qPV
LSTrdRAA7fdsLZiK70GnN1IJ4ebtkLgF+yh2RbkwXEWa1nAjAxFNyEHDPYdXyKc8
JHlfLWTlkmapR2msWKgX1HetjA5+LRnMnLu7+P+tNdjL37kEJJ3fEKuJF6S02cre
GC9zaNYpdAJohovr7zLu169RpdqZnWWw8vxMf7IKlR8j+aMFwefOgiqdLxOyw9Iw
4S5Wn3dmJOgk4lY78/Bw6rj2Spi+kdNmsWMdiYSDWghz/xL/+23Z/TfmpaokisMo
yNAE3D2i7iHJ7NND50P57BKU+MfOO6fNvyQSX2yAy0O82ANIdy1P3BDP75bSnDSb
dV0KSMpWf6X+whkQ6tl4yoUlTSLyh5r3Fspc2gFtsGlPReTaWrtAnk2+UB+/Q5/X
q319WshT2tmg0I26KVIF4IFPtVa0W2GtJftPPTD+BX8E44MbYHk6coEoqIWQiq4i
W4ogGx7/V0zf4UqVBz9pSB+gPNq4QqFsIhNOZ46hIaKcsDOuEccQbvyGSNofLggG
lUivxD8H0qk+PrITIFQKqMUDD3FF5z97bksqbaUih3E636AY9qKj57JE2LqC0Ie6
c2JhOaHKz++OZem4OSKueuvCOQ1kIaGXP0o9cFtB+JPq/qczpS26bBwdlPVVWG37
nlkFQp59/qoJJzFDcPeTuFmxYZwuI/SYzdPqFAoKiMQ9cNxmKEI=
=fxE8
-----END PGP SIGNATURE-----

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

* Re: Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)]
  2017-11-22  5:00 Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)] Nathan Aclander
@ 2017-12-01 17:28 ` Nicolas Goaziou
  2017-12-10  0:41   ` Nathan Aclander
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2017-12-01 17:28 UTC (permalink / raw)
  To: Nathan Aclander; +Cc: emacs-orgmode

Hello,

Nathan Aclander <nathan.aclander@gmail.com> writes:

> When using lists in org like the following:
>
> - Item 1
>   - Sub-item 1
>   - Sub-item 1
> - Item 2
> - Item 3
>
> I can shift them left and right using ~org-shiftmetaright~ or
> ~org-shiftmetaleft~.
>
> This also works on the following list:
>
> - Item 1
>   - This is a very long sub-item that is definitely going to be longer
>     than 80 characters.
>   - Sub-item 2
> - Item 2
> - Item 3
>
> When my cursor is on the second line ( the line that begins with "This
> is a very..." I can move the sub-item left and right as expected.
>
> When my cursor is on the third line ( the line that begins with "than
> 80..." I get a message saying:
>
> "user-error: This command is active in special context like tables,
> headlines or items"
>
> Because this *does* work when my cursor is on the above line, I know org
> knows how to handle multi line items. Therefore I think it's a bug that
> org doesn't recognize the cursor being inside a list when it is on the second
> line of a multi item list.

I don't qualify this as a bug. These commands explicitly work when point
is at the beginning of an item. Indeed, the sub-item may be arbitrarily
large, contain tables... it would be confusing to move the whole
sub-list when its structure is out of sight.

Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)]
  2017-12-01 17:28 ` Nicolas Goaziou
@ 2017-12-10  0:41   ` Nathan Aclander
  2017-12-10  1:04     ` Allen Li
  0 siblings, 1 reply; 8+ messages in thread
From: Nathan Aclander @ 2017-12-10  0:41 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Nathan Aclander, emacs-orgmode

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


Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> I don't qualify this as a bug. These commands explicitly work when point
> is at the beginning of an item. Indeed, the sub-item may be arbitrarily
> large, contain tables... it would be confusing to move the whole
> sub-list when its structure is out of sight.

Why do you think it would be confusing to move the whole sub-list? Why
would it be move confusing when the point is on the sub-item vs. when
the point is on the parent item?

I think the inconsistency is unintuitive here, and causes confusion. And
I think since large sub-items already get moved when the point is
at the beginning, it would make sense to also move them when the point
is on the sub item.

Nathan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)]
  2017-12-10  0:41   ` Nathan Aclander
@ 2017-12-10  1:04     ` Allen Li
  2017-12-10  5:25       ` Nathan Aclander
  0 siblings, 1 reply; 8+ messages in thread
From: Allen Li @ 2017-12-10  1:04 UTC (permalink / raw)
  To: Nathan Aclander; +Cc: emacs-orgmode, Nicolas Goaziou

On Sat, Dec 9, 2017 at 4:41 PM, Nathan Aclander
<nathan.aclander@gmail.com> wrote:
>
> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>> I don't qualify this as a bug. These commands explicitly work when point
>> is at the beginning of an item. Indeed, the sub-item may be arbitrarily
>> large, contain tables... it would be confusing to move the whole
>> sub-list when its structure is out of sight.
>
> Why do you think it would be confusing to move the whole sub-list? Why
> would it be move confusing when the point is on the sub-item vs. when
> the point is on the parent item?
>
> I think the inconsistency is unintuitive here, and causes confusion. And
> I think since large sub-items already get moved when the point is
> at the beginning, it would make sense to also move them when the point
> is on the sub item.
>
> Nathan

I think what Nicolas is saying is this (^ is point):

* ^Heading

M-S-left/right works here.

* Heading
^content text

M-S-left/right does not work here.  Let’s assume that it does work
here to be consistent with the feature/bug you are requesting.

* Heading

- foo
  - bar
    ^second bar line

M-S-left/right does not work here.  Let’s assume that it does work
here per the feature/bug you are requesting.  Does it move bar, foo,
or Heading?  What if the text is very long and you cannot see where
you are?

  ...
  some very long text
  ^some very long text
  some very long text
  ...

What M-S-left/right does would be very confusing.

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

* Re: Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)]
  2017-12-10  1:04     ` Allen Li
@ 2017-12-10  5:25       ` Nathan Aclander
  2017-12-10 16:01         ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Nathan Aclander @ 2017-12-10  5:25 UTC (permalink / raw)
  To: Allen Li; +Cc: Nathan Aclander, emacs-orgmode, Nicolas Goaziou

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


Allen Li <vianchielfaura@gmail.com> writes:
> I think what Nicolas is saying is this (^ is point):
>
> * ^Heading
>
> M-S-left/right works here.
>
> * Heading
> ^content text
>
> M-S-left/right does not work here.  Let’s assume that it does work
> here to be consistent with the feature/bug you are requesting.
>
> * Heading
>
> - foo
>   - bar
>     ^second bar line
>
> M-S-left/right does not work here.  Let’s assume that it does work
> here per the feature/bug you are requesting.  Does it move bar, foo,
> or Heading?  What if the text is very long and you cannot see where
> you are?
>
>   ...
>   some very long text
>   ^some very long text
>   some very long text
>   ...
>
> What M-S-left/right does would be very confusing.

Using ^ as point like you did, what I am expecting to happen is:

Case 1:
 
* Heading

- foo
  - ^bar
    second bar line

M-S-left/right moves

- bar
  second bar line 

left and right.

Case 2:

- foo
  - bar
    ^second bar line

M-S-left/right moves

- bar
  second bar line 

left and right.

Case 3:
  ...
  some very long text
  ^some very long text
  some very long text
  ...

Whatever sub list that "some very long text" is part of should be moved
left and right.

None of these scenarios seem very confusing, and ( at least to me ) seem
more consistent than the current behavior. Could you explain why you
find adding this behavior would make this confusing?

As a current workaround, what I have to do is:

1. save point
2. Go to the parent sub-list
3. Shift left or right
4. move point back to its previous location. 

Nathan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)]
  2017-12-10  5:25       ` Nathan Aclander
@ 2017-12-10 16:01         ` Nicolas Goaziou
  2017-12-10 19:33           ` Nathan Aclander
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2017-12-10 16:01 UTC (permalink / raw)
  To: Nathan Aclander; +Cc: Allen Li, emacs-orgmode

Hello,

Nathan Aclander <nathan.aclander@gmail.com> writes:

> Using ^ as point like you did, what I am expecting to happen is:
>
> Case 1:
>  
> * Heading
>
> - foo
>   - ^bar
>     second bar line
>
> M-S-left/right moves
>
> - bar
>   second bar line 
>
> left and right.
>
> Case 2:
>
> - foo
>   - bar
>     ^second bar line
>
> M-S-left/right moves
>
> - bar
>   second bar line 
>
> left and right.
>
> Case 3:
>   ...
>   some very long text
>   ^some very long text
>   some very long text
>   ...
>
> Whatever sub list that "some very long text" is part of should be moved
> left and right.
>
> None of these scenarios seem very confusing, and ( at least to me ) seem
> more consistent than the current behavior. Could you explain why you
> find adding this behavior would make this confusing?

This is confusing because it is ambiguous. The same point could
correspond to a table, multiple lists, and multiple headings, all
reclaiming S-M-left binding.

Of course, we could apply the change to the closest, i.e., the inner,
structure, but, in some cases, e.g. the third one, the context is not
obvious. You may end up ignoring if the whole section was shifted, or
just some random sub-list. 

I don't find this behaviour particularly satisfactory. OTOH, only
reacting when point is on item bullet's line is totally unambiguous.

> As a current workaround, what I have to do is:
>
> 1. save point
> 2. Go to the parent sub-list
> 3. Shift left or right
> 4. move point back to its previous location. 

You can also define a function that does this and add it to
`org-shiftmetaleft-hook' or `org-shiftmetaright-hook'.

I suggest to do that if you think that's better.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

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

* Re: Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)]
  2017-12-10 16:01         ` Nicolas Goaziou
@ 2017-12-10 19:33           ` Nathan Aclander
  2017-12-22 18:37             ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Nathan Aclander @ 2017-12-10 19:33 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Nathan Aclander, Allen Li, emacs-orgmode

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


Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> This is confusing because it is ambiguous. The same point could
> correspond to a table, multiple lists, and multiple headings, all
> reclaiming S-M-left binding.

I think I agree with your point that having the S-M-left bindings
overloaded by other modes reclaiming S-M-left will get confusing.

However, I don't use the S-M-left binding, but rather call
org-shiftmetaleft or org-shiftmetaright, I've never used other minor
modes in sublist so I'm not sure if there are any that also re-purpose
the org-shiftmetaleft/right commands.

Now I'm curious, do you have an example list where this would be
obviously confusing and ambiguous?

> You can also define a function that does this and add it to
> `org-shiftmetaleft-hook' or `org-shiftmetaright-hook'.

Yup, I wrote a function that ends up doing this for me.

Nathan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)]
  2017-12-10 19:33           ` Nathan Aclander
@ 2017-12-22 18:37             ` Nicolas Goaziou
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2017-12-22 18:37 UTC (permalink / raw)
  To: Nathan Aclander; +Cc: Allen Li, emacs-orgmode

Hello,

Nathan Aclander <nathan.aclander@gmail.com> writes:

> Now I'm curious, do you have an example list where this would be
> obviously confusing and ambiguous?

    * Headline 1

    ** Sub-headline

    - Plain list

      - Sub-list

      - Sub-item

        [X]


If the point is at [X], any headline, plain-list or item could claim
`M-S-<left>'. This can be confusing if the surrounding structure is not
visible around point.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

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

end of thread, other threads:[~2017-12-22 18:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22  5:00 Bug: shiftmeta[left|right] on multi line items [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/local/share/emacs/27.0.50/lisp/org/)] Nathan Aclander
2017-12-01 17:28 ` Nicolas Goaziou
2017-12-10  0:41   ` Nathan Aclander
2017-12-10  1:04     ` Allen Li
2017-12-10  5:25       ` Nathan Aclander
2017-12-10 16:01         ` Nicolas Goaziou
2017-12-10 19:33           ` Nathan Aclander
2017-12-22 18:37             ` 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).