Alexandros Prekates <apreka...@posteo.net> writes:

> I give a couple of examples that i think highligth some foggy semantics
> of links.
>
> In the example below . is the pointer and single quotes is for
> recognized links and $ for the start of the line.
>
>    $[[foo]].
>    $'foo'.
>    $.'foo'         // here while we could think that the pointer is
>                    // before the link , if we type a char it will 
>                    // be inserted into the link.
>    $'xfoo'         // not x'foo'

This is not about semantics. The point position when there is hidden
text is generally ambiguous. Emacs chooses to put point before or after
invisible text depending on the "direction" of the last command. See
22.6 Adjusting Point After Commands section of Elisp manual, if you want
to know the details. The scenario when invisible text is right at bol is
the most tricky. 

> Also what if we type :
>    $and [[foo]].
>    $and 'foo'.
>    $.and 'foo'
>    $[[goo. and 'foo' //Could not be seen as [[ goo and  [[foo ]]    ?
>                      //                        'goo and [[foo'
>                                              
>                      // But that doesnt happens.
>                      // Org sees it as :
>    $[[goo.  and  'foo' 
>    $[[goo]]  and 'foo'
>    $'goo' and 'foo'

Unescaped brackets are not allowed in the link path.
See 4.1 Link Format section of the manual

      [[LINK][DESCRIPTION]]
     
     or alternatively
     
          [[LINK]]
     
        Some ‘\’, ‘[’ and ‘]’ characters in the LINK part need to be
     “escaped”, i.e., preceded by another ‘\’ character.  More specifically,
     the following characters, and only them, must be escaped:
     
       1. all ‘[’ and ‘]’ characters,
       2. every ‘\’ character preceding either ‘]’ or ‘[’,
       3. every ‘\’ character at the end of the link.

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

Reply via email to