Re: Incorrect quantity of en-spaces

2023-10-19 Thread Ihor Radchenko
"Tom Alexander"  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 .
Support Org development at ,
or support my work at 



Re: Incorrect quantity of en-spaces

2023-10-18 Thread Tom Alexander
> This appears to be a special case, not documented on org-syntax page.

Sounds good, thanks! 

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



Re: Incorrect quantity of en-spaces

2023-10-18 Thread Ihor Radchenko
"Tom Alexander"  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 .
Support Org development at ,
or support my work at 



Incorrect quantity of en-spaces

2023-10-16 Thread Tom Alexander
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