emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] org-id: allow using parent's existing id in links to headlin


From: Ihor Radchenko
Subject: Re: [PATCH] org-id: allow using parent's existing id in links to headlines
Date: Fri, 10 Nov 2023 10:03:49 +0000

"Rick Lupton" <mail@ricklupton.name> writes:

> On Tue, 25 Jul 2023, at 8:43 AM, Ihor Radchenko wrote:
>> Ideally, we should have all the necessary logic to store the link within
>> `org-id-store-link' and then use `org-link-set-parameters' to configure
>> id links.
>
> I agree this would be neater, but looking at how this would work, I have a 
> question:
>
> Behaviour in `org-store-link` currently depends on the `interactive?` 
> argument, e.g. in this logic
>
> (and interactive?
>      (or (eq org-id-link-to-org-use-id 'create-if-interactive)
>          (and (eq org-id-link-to-org-use-id
>                   'create-if-interactive-and-no-custom-id)
>               (not custom-id))))
>
> To move this logic to `org-id-store-link`, is there a way that 
> `org-id-store-link` can tell whether `org-store-link` was called (a) 
> interactively, or (b) with the `interactive?` argument true?

I think that we need to make a change in the rules for :store functions.
`interactive?' may be passed as the argument to these functions.

In order to not cause breakage, we need something like

(condition-case nil
                 (funcall protocol path desc backend info)
               ;; XXX: The function used (< Org 9.4) to accept only
               ;; three mandatory arguments.  Type-specific `:export'
               ;; functions in the wild may not handle current
               ;; signature.  Provide backward compatibility support
               ;; for them.
               (wrong-number-of-arguments
                (funcall protocol path desc backend)))

to keep the old :store functions that accept 0 arguments working.

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