emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC][PATCH] Allow to export to ascii custom link types as notes


From: Ihor Radchenko
Subject: Re: [RFC][PATCH] Allow to export to ascii custom link types as notes
Date: Tue, 24 Oct 2023 10:40:41 +0000

Max Nikulin <manikulin@gmail.com> writes:

> However "cond form will work without changes" is not clear for me. 
> `org-export-custom-protocol-maybe' is called twice and depending on 
> context the result should be either "[description]" inline or 
> "[description] path" for note, so the code around 
> `org-export-custom-protocol-maybe' has to be changed.

I see.
What about (1) passing link object to custom protocol, (2) making
`org-ascii-make-link-with-note' marking the link object to be recorded
in notes; (3) modifying `org-ascii--describe-links' to check for the
recorded mark before the `cond' clause (org-export-custom-protocol-maybe...).

>>>         [Org mode] (<http://orgmode.org>)
>>> man
>>>         man (http://man.he.net/?topic=man&section=all)
>> 
>> This is probably a bug in ol-man.
>
> Which one? Absence of square brackets? Absence of angle brackets? Both?

Should be [man] (<http://man.he.net/?topic=man&section=all>)

>>> internal
>>>         heading (See section 1)
>> 
>> I see no problem here - internal links are special, and it makes sense to
>> drop angle brackets, unlike external web links that are often marked
>> with angle brackets in the wild.
>
> Due to absence of square brackets around "heading" it should be treated 
> differently from e.g. http links.

Hmm.. I do see a problem now. To be consistent, it should be

[heading] (See section 1)

By "special" I meant URL/path part.

> ... It is the reason why I added a regexp 
> to detect if a caller added square brackets:
>
>>>>>>> +           (if (string-match-p "\\`\u200b*\\[.*\\]\u200b*\\'" anchor)
>>>>>>> +               anchor
>>>>>>> +            (format "[%s]" anchor))

I still fail to see how it is related to the problem at hand: "Allow to
export to ascii custom link types as notes". We had this problem for
non-custom links in the past and we still have it. It should be solved
separately.

> I do not like repetitions in the current code.

Me either. But let's address them separately. Otherwise, it is very hard
to keep track of the discussion.

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

[Prev in Thread] Current Thread [Next in Thread]