all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Consecutive plain list items of different types
@ 2023-09-22  0:41 Tom Alexander
  2023-09-22  9:24 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Alexander @ 2023-09-22  0:41 UTC (permalink / raw)
  To: emacs-orgmode

The org-mode documentation[1] states for plain lists that:
> List types are mutually exclusive at the same level of indentation, if both types are present consecutively then they parse as separate lists.

first a minor nit-pick that "both" is probably not the correct word here since there are 3 types of lists, not two (unordered, ordered, and descriptive). I'd go with "multiple" instead IMO.

but more importantly, based on that description I would expect the following test document to parse into three separate plain lists, but it parses as a single plain list with 3 items:

```
1. foo
- bar
- lorem :: ipsum
```

[1] https://orgmode.org/worg/org-syntax.html#Plain_Lists

--
Tom Alexander
pgp: https://fizz.buzz/pgp.asc


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

* Re: Consecutive plain list items of different types
  2023-09-22  0:41 Consecutive plain list items of different types Tom Alexander
@ 2023-09-22  9:24 ` Ihor Radchenko
  2024-05-03 11:07   ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2023-09-22  9:24 UTC (permalink / raw)
  To: Tom Alexander, Timothy; +Cc: emacs-orgmode

"Tom Alexander" <tom@fizz.buzz> writes:

> The org-mode documentation[1] states for plain lists that:
>> List types are mutually exclusive at the same level of indentation, if both types are present consecutively then they parse as separate lists.
>
> first a minor nit-pick that "both" is probably not the correct word here since there are 3 types of lists, not two (unordered, ordered, and descriptive). I'd go with "multiple" instead IMO.

Fixed.
https://git.sr.ht/~bzg/worg/commit/c7445f84

> but more importantly, based on that description I would expect the following test document to parse into three separate plain lists, but it parses as a single plain list with 3 items:
>
> ```
> 1. foo
> - bar
> - lorem :: ipsum
> ```
>
> [1] https://orgmode.org/worg/org-syntax.html#Plain_Lists

AFAIK, the first item determines the list type in our parser.
Timothy, do you remember why you wrote about different list types being
parsed separately?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: Consecutive plain list items of different types
  2023-09-22  9:24 ` Ihor Radchenko
@ 2024-05-03 11:07   ` Ihor Radchenko
  2024-05-03 16:39     ` Tom Gillespie
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2024-05-03 11:07 UTC (permalink / raw)
  To: Tom Alexander, Tom Gillespie; +Cc: Timothy, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

>> but more importantly, based on that description I would expect the following test document to parse into three separate plain lists, but it parses as a single plain list with 3 items:
>>
>> ```
>> 1. foo
>> - bar
>> - lorem :: ipsum
>> ```
>>
>> [1] https://orgmode.org/worg/org-syntax.html#Plain_Lists
>
> AFAIK, the first item determines the list type in our parser.
> Timothy, do you remember why you wrote about different list types being
> parsed separately?

I see no explanation, except reference to previous discussions with Tom
Gillespie. However, searching in the archives, I do not see anything
related to plain list parser.

Considering that the parser does not distinguish consecutive lists of the
same time (unless they are properly separated with double blank), I
removed the confusing statement.

Fixed.
https://git.sr.ht/~bzg/worg/commit/81425d84

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: Consecutive plain list items of different types
  2024-05-03 11:07   ` Ihor Radchenko
@ 2024-05-03 16:39     ` Tom Gillespie
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Gillespie @ 2024-05-03 16:39 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tom Alexander, Timothy, emacs-orgmode

IIRC I wrote the part about there being two types of lists at the syntax level,
which are bulleted and numbered, descriptive are effectively bulleted in the
context of this behavior, but I think it is fine to say multiple.

With regard to the stated behavior about consecutive being parsed separately
I don't remember writing that part unless as was suggested I mean that they
were fully separate lists, but that wouldn't make sense.

The behavior is that everything at a level is converted to the type of
the first occurring list item at that level.

One wrinkle is that when applied to individual list items org-element
will report the type as written (which is expected) however on export
they are converted to the type of the first occurring item.

So the now-removed sentence might have referred to the org-element behavior.

Regardless, the change is an improvement. Thanks!

Tom


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

end of thread, other threads:[~2024-05-03 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-22  0:41 Consecutive plain list items of different types Tom Alexander
2023-09-22  9:24 ` Ihor Radchenko
2024-05-03 11:07   ` Ihor Radchenko
2024-05-03 16:39     ` Tom Gillespie

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.