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

2023-11-11 Thread Ihor Radchenko
Max Nikulin writes: > On 08/11/2023 18:16, Ihor Radchenko wrote: >> We can introduce a special ox-ascii-specific object `object-with-note' >> that will be exported by ox-ascii according to >> `org-ascii-links-to-notes' settings. Then, we can transform link objects >> into `object-with-note' that

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

2023-11-09 Thread Max Nikulin
On 08/11/2023 18:16, Ihor Radchenko wrote: We can introduce a special ox-ascii-specific object `object-with-note' that will be exported by ox-ascii according to `org-ascii-links-to-notes' settings. Then, we can transform link objects into `object-with-note' that will later be used in

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

2023-11-08 Thread Ihor Radchenko
Max Nikulin writes: > On 08/11/2023 17:45, Ihor Radchenko wrote: >> (unless (org-element-property :org-link-code-exported link) >> (setq link (org-element-copy link)) >> (org-element-put-property link :org-link-code-exported t) >> (org-element-put-property :raw-link

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

2023-11-08 Thread Max Nikulin
On 08/11/2023 17:45, Ihor Radchenko wrote: (unless (org-element-property :org-link-code-exported link) (setq link (org-element-copy link)) (org-element-put-property link :org-link-code-exported t) (org-element-put-property :raw-link (org-element-create-inline-src-block ...))) From my

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

2023-11-08 Thread Ihor Radchenko
Max Nikulin writes: >> We can alternatively check function arity. > > 5 unnamed arguments for functions that are supposed to be implemented by > users looks rather close to a border when it becomes fragile. The > language does not enforce type checking for user-supplied functions and > users

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

2023-11-08 Thread Max Nikulin
On 07/11/2023 18:58, Ihor Radchenko wrote: Max Nikulin writes: (funcall protocol path desc backend info *link-object*) It would require another iteration with `condition-case' to deal with functions having old signature. Is it a problem? Performance for large projects like Worg. We can

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

2023-11-07 Thread Ihor Radchenko
Max Nikulin writes: >> What about passing an extra argument to :export function in >> `org-export-custom-protocol-maybe': >> >> (funcall protocol path desc backend info *link-object*) > > It would require another iteration with `condition-case' to deal with > functions having old signature.

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

2023-11-07 Thread Max Nikulin
On 07/11/2023 16:30, Ihor Radchenko wrote: Max Nikulin writes: What about passing an extra argument to :export function in `org-export-custom-protocol-maybe': (funcall protocol path desc backend info *link-object*) It would require another iteration with `condition-case' to deal with

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

2023-11-07 Thread Ihor Radchenko
Max Nikulin writes: > `cons' is made an implementation detail, however completely opaque > structure is an obstacle for derived export backend. Perhaps getter > functions should be introduced as well. I am looking at this again and the approach with special return values really feels like a

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

2023-10-25 Thread Max Nikulin
On 23/10/2023 19:09, Ihor Radchenko wrote: + (if (string-match-p "\\`\u200b*\\[.*\\]\u200b*\\'" anchor) + anchor +(format "[%s]" anchor)) I did not mean unrelated to ox-ascii. I meant unrelated to "add new feature allowing more flexibility for :export