emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Incorrect quantity of en-spaces
@ 2023-10-16 18:05 Tom Alexander
  2023-10-18  9:50 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Alexander @ 2023-10-16 18:05 UTC (permalink / raw)
  To: emacs-orgmode

The org-mode syntax document describes entities as:
> \NAME POST
> \NAME{}
> Where NAME and POST are not separated by a whitespace character.

and POST is defined as:
> Either the end of line or a non-alphabetic character.

So using the test document:
```
\_   Foo
```
(a backslash, underscore, three spaces, and then the word Foo)

I would expect to get only 2 en-spaces but I am getting 3. Looking at org-entities, an underscore with 2 spaces gets 2 en-spaces, whereas an underscore with 3 spaces gets 3 en-spaces, but if we match all 3 spaces as NAME then POST becomes invalid because "F" is neither the end of the line nor a non-alphabetic character, so we can only match the first two spaces as NAME.

emacs version: 29.1
org-mode version: 9bbc21df84d507e568a3ebd17e105cdb9e163784 (latest in git)

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


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

* Re: Incorrect quantity of en-spaces
  2023-10-16 18:05 Incorrect quantity of en-spaces Tom Alexander
@ 2023-10-18  9:50 ` Ihor Radchenko
  2023-10-18 15:37   ` Tom Alexander
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2023-10-18  9:50 UTC (permalink / raw)
  To: Tom Alexander; +Cc: emacs-orgmode

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

> The org-mode syntax document describes entities as:
>> \NAME POST
>> \NAME{}
>> Where NAME and POST are not separated by a whitespace character.
>
> and POST is defined as:
>> Either the end of line or a non-alphabetic character.
>
> So using the test document:
> ```
> \_   Foo
> ```
> (a backslash, underscore, three spaces, and then the word Foo)
>
> I would expect to get only 2 en-spaces but I am getting 3. Looking at
> org-entities, an underscore with 2 spaces gets 2 en-spaces, whereas an
> underscore with 3 spaces gets 3 en-spaces, but if we match all 3
> spaces as NAME then POST becomes invalid because "F" is neither the
> end of the line nor a non-alphabetic character, so we can only match
> the first two spaces as NAME.

This appears to be a special case, not documented on org-syntax page.

When users want to add non-standard space\_     , it should not be
treated as\_    {} - with extra space after the entity. Otherwise, users
might get unexpected results during export, with additional normal space
after user-defined.

Does it make sense to you?

-- 
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: Incorrect quantity of en-spaces
  2023-10-18  9:50 ` Ihor Radchenko
@ 2023-10-18 15:37   ` Tom Alexander
  2023-10-19  8:18     ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Alexander @ 2023-10-18 15:37 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

> This appears to be a special case, not documented on org-syntax page.

Sounds good, thanks! 

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


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

* Re: Incorrect quantity of en-spaces
  2023-10-18 15:37   ` Tom Alexander
@ 2023-10-19  8:18     ` Ihor Radchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2023-10-19  8:18 UTC (permalink / raw)
  To: Tom Alexander; +Cc: emacs-orgmode

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

>> This appears to be a special case, not documented on org-syntax page.
>
> Sounds good, thanks! 

Updated org-syntax document:
https://git.sr.ht/~bzg/worg/commit/71077014

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

end of thread, other threads:[~2023-10-19  8:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 18:05 Incorrect quantity of en-spaces Tom Alexander
2023-10-18  9:50 ` Ihor Radchenko
2023-10-18 15:37   ` Tom Alexander
2023-10-19  8:18     ` 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).