emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] lisp/org-capture.el: use link ID's for %K


From: Kenny Ballou
Subject: Re: [PATCH] lisp/org-capture.el: use link ID's for %K
Date: Mon, 11 Dec 2023 08:33:26 -0700
User-agent: mu4e 1.10.8; emacs 30.0.50

On 2023-12-10 12:19 GMT, Ihor Radchenko wrote:
> Kenny Ballou <kb@devnulllabs.io> writes:
>
>>
>> I ended up using `org-store-link-plist'.  For some reason that I don't
>> understand, the `save-excursion' -> `org-store-link' was not updating
>> `org-stored-links'.
>
> I can see it from the code now. Basically, instead of updating
> `org-stored-links', `org-store-link' returns the link when called
> non-interactively (with nil INTERACTIVE? argument).
> Now documented on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5e809903d

Thank you for this!

>
>> ... Similarly, I had to use `save-window-excursion' or
>> the `org-clock-goto' would really break things.
>
> You should not use `org-clock-goto' - it is intended for interactive use
> and does a lot of unnecessary work.
> You may instead do (org-with-point-at org-clock-marker ...)

Yes, it felt heavy handed, and I haven't quite figured out how to query
the current set of functions for desired functionality.  Thank you for
your patience in this process, I believe it has really simplified the
change and the resulting patch (to follow).

Using your suggestions, I believe we can simply grab the link from
`org-store-link' and use it (almost) directly as the value of %K.
Furthermore, we do not need to branch off `org-id-link-to-use-id'
because the correct behavior is captured by `org-store-link'.

My remaining question is whether I should use `current-prefix-arg' or
not?  I'm not sure if that would be surprising or not, or if it would
even get to `org-store-link' when doing a capture.

-- 
-Kenny



reply via email to

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