emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* asterisk allowed for list items
@ 2022-04-29 11:53 c.buhtz
  2022-04-29 12:15 ` Ihor Radchenko
  2022-04-29 12:17 ` c.buhtz
  0 siblings, 2 replies; 11+ messages in thread
From: c.buhtz @ 2022-04-29 11:53 UTC (permalink / raw)
  To: Emacs orgmode

I was looking into https://orgmode.org/worg/dev/org-syntax.html#Items to 
find out which characters are allowed as "bullets" for unorderd lists.

I cite from there
"An asterisk, hyphen, or plus sign character (i.e., *, -, or +)."

I wonder why * is allowed because * also starts a heading. So how does a 
piece of software/parser decide if a line starting with an * is a 
heading or a list item?


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

* Re: asterisk allowed for list items
  2022-04-29 11:53 asterisk allowed for list items c.buhtz
@ 2022-04-29 12:15 ` Ihor Radchenko
  2022-04-29 12:21   ` c.buhtz
  2022-04-29 12:17 ` c.buhtz
  1 sibling, 1 reply; 11+ messages in thread
From: Ihor Radchenko @ 2022-04-29 12:15 UTC (permalink / raw)
  To: c.buhtz; +Cc: Emacs orgmode

c.buhtz@posteo.jp writes:

> I cite from there
> "An asterisk, hyphen, or plus sign character (i.e., *, -, or +)."
>
> I wonder why * is allowed because * also starts a heading. So how does a 
> piece of software/parser decide if a line starting with an * is a 
> heading or a list item?

Headlines always start at beginning of line and have stars followed by space:

* this is a heading
** this is also a heading
**but this is not (no space after stars)
 * this is a list item (star not at bol)

Would you be interested to contribute an example to
https://orgmode.org/worg/dev/org-syntax.html#Items ?

Best,
Ihor


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

* Re: asterisk allowed for list items
  2022-04-29 11:53 asterisk allowed for list items c.buhtz
  2022-04-29 12:15 ` Ihor Radchenko
@ 2022-04-29 12:17 ` c.buhtz
  2022-04-29 13:04   ` Detlef Steuer
  2022-04-29 13:54   ` Ihor Radchenko
  1 sibling, 2 replies; 11+ messages in thread
From: c.buhtz @ 2022-04-29 12:17 UTC (permalink / raw)
  To: Emacs orgmode

I need to add something here and think the syntax description should be 
updated about that.

A "*" is allowed or recognized as a list item instead as a head only if 
there is one (or maybe more) whitespace space in front of it.

But "-" and "+" also recognized as starts for list items without any 
trailing whitespace in front of them.

Sidenote: As someone who writes software that parse org-content I would 
suggest to make the whitespace in front of a list item mandatory even 
for "-" and "+". It would reduce code complexity.

Am 29.04.2022 13:53 schrieb c.buhtz@posteo.jp:
> I was looking into https://orgmode.org/worg/dev/org-syntax.html#Items
> to find out which characters are allowed as "bullets" for unorderd
> lists.
> 
> I cite from there
> "An asterisk, hyphen, or plus sign character (i.e., *, -, or +)."
> 
> I wonder why * is allowed because * also starts a heading. So how does
> a piece of software/parser decide if a line starting with an * is a
> heading or a list item?


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

* Re: asterisk allowed for list items
  2022-04-29 12:15 ` Ihor Radchenko
@ 2022-04-29 12:21   ` c.buhtz
  2022-04-29 13:49     ` Ihor Radchenko
  0 siblings, 1 reply; 11+ messages in thread
From: c.buhtz @ 2022-04-29 12:21 UTC (permalink / raw)
  To: Emacs orgmode

Am 29.04.2022 14:15 schrieb Ihor Radchenko:
> Would you be interested to contribute an example to
> https://orgmode.org/worg/dev/org-syntax.html#Items ?

Not sure what you mean. Currently I just try to understand the syntax 
and get the hard rules for my own parser. ;)

  - List item with whitespace before and after bullet
  + List item with whitespace before and after bullet
  * List item with whitespace before and after bullet

- List item with whitespace only after bullet
+ List item with whitespace only after bullet
* A heading because there is no whitespace before the bullet

btw: There is a "problem" with the mailinglist. Follow-Up and Reply-To 
is ignored. I always get copy to my own adress instead of the 
mailinglist. I do not need copies. This is noise.


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

* Re: asterisk allowed for list items
  2022-04-29 12:17 ` c.buhtz
@ 2022-04-29 13:04   ` Detlef Steuer
  2022-04-29 13:22     ` c.buhtz
  2022-04-29 13:54   ` Ihor Radchenko
  1 sibling, 1 reply; 11+ messages in thread
From: Detlef Steuer @ 2022-04-29 13:04 UTC (permalink / raw)
  To: emacs-orgmode

Am Fri, 29 Apr 2022 12:17:24 +0000
schrieb c.buhtz@posteo.jp:

> Sidenote: As someone who writes software that parse org-content I
> would suggest to make the whitespace in front of a list item
> mandatory even for "-" and "+". It would reduce code complexity.

But *first* it should be easily read- and writable by humans and only
then easily parseble by parsers! At least imho.

Detlef




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

* Re: asterisk allowed for list items
  2022-04-29 13:04   ` Detlef Steuer
@ 2022-04-29 13:22     ` c.buhtz
  2022-04-29 13:59       ` Ihor Radchenko
  0 siblings, 1 reply; 11+ messages in thread
From: c.buhtz @ 2022-04-29 13:22 UTC (permalink / raw)
  To: emacs-orgmode

Dear Detlef

Am 29.04.2022 15:04 schrieb Detlef Steuer:
> But *first* it should be easily read- and writable by humans and only
> then easily parseble by parsers! At least imho.

I agree and understand that this is one of the design principals of Org.

But even for humans the current situation is IMHO not "easy". When I 
want to have asterix bullet for my list items I always have to think 
about the trailing whitespace to prevent Org from interpreting this as a 
heading.


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

* Re: asterisk allowed for list items
  2022-04-29 12:21   ` c.buhtz
@ 2022-04-29 13:49     ` Ihor Radchenko
  2022-04-29 14:26       ` c.buhtz
  0 siblings, 1 reply; 11+ messages in thread
From: Ihor Radchenko @ 2022-04-29 13:49 UTC (permalink / raw)
  To: c.buhtz; +Cc: Emacs orgmode

c.buhtz@posteo.jp writes:

> Am 29.04.2022 14:15 schrieb Ihor Radchenko:
>> Would you be interested to contribute an example to
>> https://orgmode.org/worg/dev/org-syntax.html#Items ?
>
> Not sure what you mean. Currently I just try to understand the syntax 
> and get the hard rules for my own parser. ;)

Exactly because you are actively trying to understand the syntax, you
are in unique situation where you can easily see all the "opaque" places
in the syntax description. That's why I ask you to propose modifications
to the document that would make it easier to read for you.

Ideally, the modifications should be the form of a patch :)

> btw: There is a "problem" with the mailinglist. Follow-Up and Reply-To 
> is ignored. I always get copy to my own adress instead of the 
> mailinglist. I do not need copies. This is noise.

I do not think that it is a problem of the mailing list software. Rather
we are used to Reply-All to make sure that people who are not subscribed
are kept in the look. Getting a copy to your own address is a side
effect.

Best,
Ihor


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

* Re: asterisk allowed for list items
  2022-04-29 12:17 ` c.buhtz
  2022-04-29 13:04   ` Detlef Steuer
@ 2022-04-29 13:54   ` Ihor Radchenko
  1 sibling, 0 replies; 11+ messages in thread
From: Ihor Radchenko @ 2022-04-29 13:54 UTC (permalink / raw)
  To: c.buhtz; +Cc: Emacs orgmode

c.buhtz@posteo.jp writes:

> Sidenote: As someone who writes software that parse org-content I would 
> suggest to make the whitespace in front of a list item mandatory even 
> for "-" and "+". It would reduce code complexity.

It might probably simplify things for third-party parsers. Not for
org-element. The "^* " vs "^ * " is distinguished without much efforts
on Org side because of hierarchical matching (headlines have higher
priority over lists). Moreover Org is trying to be as back-compatible as
possible, so minor simplification is not sufficient to advocate changing
Org syntax.

Best,
Ihor


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

* Re: asterisk allowed for list items
  2022-04-29 13:22     ` c.buhtz
@ 2022-04-29 13:59       ` Ihor Radchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Ihor Radchenko @ 2022-04-29 13:59 UTC (permalink / raw)
  To: c.buhtz; +Cc: emacs-orgmode

c.buhtz@posteo.jp writes:

> Am 29.04.2022 15:04 schrieb Detlef Steuer:
>> But *first* it should be easily read- and writable by humans and only
>> then easily parseble by parsers! At least imho.
>
> I agree and understand that this is one of the design principals of Org.
>
> But even for humans the current situation is IMHO not "easy". When I 
> want to have asterix bullet for my list items I always have to think 
> about the trailing whitespace to prevent Org from interpreting this as a 
> heading.

If you want to avoid this confusion, just don't use asterisks in lists.
Yet, Org still provides this option if you suddenly need to use
asterisks in some weird scenario :)

Generally, fontification is a guide.

Best,
Ihor



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

* Re: asterisk allowed for list items
  2022-04-29 13:49     ` Ihor Radchenko
@ 2022-04-29 14:26       ` c.buhtz
  2022-04-30  5:37         ` Ihor Radchenko
  0 siblings, 1 reply; 11+ messages in thread
From: c.buhtz @ 2022-04-29 14:26 UTC (permalink / raw)
  To: Emacs orgmode

Dear Ihor,

thanks for your reply.

Am 29.04.2022 15:49 schrieb Ihor Radchenko:
> Exactly because you are actively trying to understand the syntax, you
> are in unique situation where you can easily see all the "opaque" 
> places
> in the syntax description.

I still don't know if I misunderstand the syntax description document or 
if there is really and "error" in it.

> That's why I ask you to propose modifications
> to the document that would make it easier to read for you.

First of all I have to understand everything and then write that down 
for my self (especially as Python code and unittests).

My english is awful and it wouldn't help you. I even do not understand 
all words and sentences (from a language perspective) of the syntax 
description document. I am not into it enough to propose a patch. I can 
only offer you "my understanding" of the document and "testing" a new 
version of it.


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

* Re: asterisk allowed for list items
  2022-04-29 14:26       ` c.buhtz
@ 2022-04-30  5:37         ` Ihor Radchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Ihor Radchenko @ 2022-04-30  5:37 UTC (permalink / raw)
  To: c.buhtz; +Cc: Emacs orgmode

c.buhtz@posteo.jp writes:

> Am 29.04.2022 15:49 schrieb Ihor Radchenko:
>> Exactly because you are actively trying to understand the syntax, you
>> are in unique situation where you can easily see all the "opaque" 
>> places
>> in the syntax description.
>
> I still don't know if I misunderstand the syntax description document or 
> if there is really and "error" in it.

Ideally, our document should be reasonably easy to understand for native
or non-native English speakers. So, please keep posting if you find some
parts difficult.

>> That's why I ask you to propose modifications
>> to the document that would make it easier to read for you.
>
> First of all I have to understand everything and then write that down 
> for my self (especially as Python code and unittests).
>
> My english is awful and it wouldn't help you. I even do not understand 
> all words and sentences (from a language perspective) of the syntax 
> description document. I am not into it enough to propose a patch. I can 
> only offer you "my understanding" of the document and "testing" a new 
> version of it.

Well. The document has been written by native speaker of (AFAIK)
Australian English. I myself (non-native speaker) had hard time
understanding some parts given my experience with American English. If
you observe some particularly tricky sentences, feel free to complain
here :) The goal of that document is to make things easier, not harder
for the reader.

Best,
Ihor



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

end of thread, other threads:[~2022-04-30  5:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 11:53 asterisk allowed for list items c.buhtz
2022-04-29 12:15 ` Ihor Radchenko
2022-04-29 12:21   ` c.buhtz
2022-04-29 13:49     ` Ihor Radchenko
2022-04-29 14:26       ` c.buhtz
2022-04-30  5:37         ` Ihor Radchenko
2022-04-29 12:17 ` c.buhtz
2022-04-29 13:04   ` Detlef Steuer
2022-04-29 13:22     ` c.buhtz
2022-04-29 13:59       ` Ihor Radchenko
2022-04-29 13:54   ` Ihor Radchenko

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