all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Inserting links stored in `org-store-link-plist`
@ 2022-02-17 23:26 Alejandro Pérez Carballo
  2022-02-23 15:50 ` Max Nikulin
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Pérez Carballo @ 2022-02-17 23:26 UTC (permalink / raw)
  To: emacs-orgmode

Hello, 

After storing a link to an ID using `org-id-store-link` I would've expected the stored link to be made available when calling `org-insert-link`, much like when storing a link using `org-store-link. But that's not what I see: the link stored with `org-id-store-link` is added to `org-store-link-plist` but not to `org-stored-links`. 

To my surprise (and this may not be related, but in case it is), the value of `org-store-link-plist` is set to `nil` if I call `org-store-link`. Somehow calling `org-store-link` results in both the value of the stored link being sent to `org-stored-links` *and* in the value of `org-store-link-plist`, but calling `org-id-store-link` results in the stored link being sent to `org-store-link-plist` without touching the value of `org-stored-links`. 

I'm assuming this is not the expected behavior, but if it is, I'd appreciate any suggestions for how to use the values of `org-store-link-plist` when calling `org-insert-link`. 

I'm seeing this both with 9.5.2 and 9.5.1.

Thanks in advance for any help, 

APC

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Inserting links stored in `org-store-link-plist`
  2022-02-17 23:26 Inserting links stored in `org-store-link-plist` Alejandro Pérez Carballo
@ 2022-02-23 15:50 ` Max Nikulin
  2022-02-24 21:11   ` Alejandro Pérez Carballo
  0 siblings, 1 reply; 5+ messages in thread
From: Max Nikulin @ 2022-02-23 15:50 UTC (permalink / raw)
  To: Alejandro Pérez Carballo, emacs-orgmode

On 18/02/2022 06:26, Alejandro Pérez Carballo wrote:
> 
> After storing a link to an ID using `org-id-store-link` I would've
> expected the stored link to be made available when calling
> `org-insert-link`,
I would expect that to store ID link it should be enough to call 
`org-store-link' having proper configuration. This function calls 
`org-id-store-link`, see 
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/ol.el#n1634

Unfortunately you did not describe your real problem (or your goal). I 
am aware of a problem with storing CUSTOM_ID links but it is unlikely 
related to your one: 
https://list.orgmode.org/e2c807a7-1924-6f08-9e63-4f70aee9d3b5@gmail.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Inserting links stored in `org-store-link-plist`
  2022-02-23 15:50 ` Max Nikulin
@ 2022-02-24 21:11   ` Alejandro Pérez Carballo
  2022-02-25 16:25     ` Max Nikulin
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Pérez Carballo @ 2022-02-24 21:11 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Thanks for your reply. I can store the ID calling `org-store-link' if `org-id-link-to-org-use-id' is set to a non-nil value. But I wanted to be able to have `org-id-link-to-org-use-id' set to nil and also have a function to store an ID link. (I make use of ID only in certain files and try to avoid them otherwise, preferring the default method of using a link to the file with a search string pointing to the current line in most cases.)  

I had expected that `org-insert-link' would be able to retrieve links stored both with `org-store-link' and `org-id-store-link'—it seemed like a natural assumption, perhaps because I do not know of other reasons for having an interactive function that stores links aside from being able to insert them later?  But if the point of `org-id-store-link' is not to supply values for `org-insert-link', please ignore this.

For now, I've just defined a simple wrapper that temporarily sets the value of `org-id-link-to-org-use-id' to `use-existing' and calls `org-store-link', and that works fine.

Thanks again, 

Alejandro

> On Feb 23, 2022, at 7:50 AM, Max Nikulin <manikulin@gmail.com> wrote:
> 
> On 18/02/2022 06:26, Alejandro Pérez Carballo wrote:
>> After storing a link to an ID using `org-id-store-link` I would've
>> expected the stored link to be made available when calling
>> `org-insert-link`,
> I would expect that to store ID link it should be enough to call `org-store-link' having proper configuration. This function calls `org-id-store-link`, see https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/ol.el#n1634
> 
> Unfortunately you did not describe your real problem (or your goal). I am aware of a problem with storing CUSTOM_ID links but it is unlikely related to your one: https://list.orgmode.org/e2c807a7-1924-6f08-9e63-4f70aee9d3b5@gmail.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Inserting links stored in `org-store-link-plist`
  2022-02-24 21:11   ` Alejandro Pérez Carballo
@ 2022-02-25 16:25     ` Max Nikulin
  2022-02-25 17:21       ` Alejandro Pérez Carballo
  0 siblings, 1 reply; 5+ messages in thread
From: Max Nikulin @ 2022-02-25 16:25 UTC (permalink / raw)
  To: Alejandro Pérez Carballo; +Cc: emacs-orgmode

On 25/02/2022 04:11, Alejandro Pérez Carballo wrote:
> Thanks for your reply. I can store the ID calling `org-store-link'
> if `org-id-link-to-org-use-id' is set to a non-nil value. But I 
> wanted to be able to have `org-id-link-to-org-use-id' set to nil and
> also have a function to store an ID link. (I make use of ID only in
> certain files and try to avoid them otherwise, preferring the default
> method of using a link to the file with a search string pointing to
> the current line in most cases.)

I have no idea what interface `org-store-link' should have to be really 
flexible and convenient.

Have you considered file- (or directory-) local variables?
info "(emacs) Specifying File Variables"
https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html

# Local Variables:
# org-id-link-to-org-use-id: use-existing
# End:

at the end of specific files.

> I had expected that `org-insert-link' would be able to retrieve 
> links stored both with `org-store-link' and `org-id-store-link'—it
> seemed like a natural assumption, perhaps because I do not know of
> other reasons for having an interactive function that stores links
> aside from being able to insert them later?
I can not say that I am happy with implementation of `org-store-link' or 
that I fully understand ideas behind ol.el. I just found an example of 
`org-id-store-link' usage:
https://git.sr.ht/~bzg/org-contrib/tree/master/item/lisp/org-contacts.el#L1171
see definition of "org-contact" link a bit above as well.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Inserting links stored in `org-store-link-plist`
  2022-02-25 16:25     ` Max Nikulin
@ 2022-02-25 17:21       ` Alejandro Pérez Carballo
  0 siblings, 0 replies; 5+ messages in thread
From: Alejandro Pérez Carballo @ 2022-02-25 17:21 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Thanks for the suggestions! Will have a look. 

Best, 

A. 

> On Feb 25, 2022, at 8:25 AM, Max Nikulin <manikulin@gmail.com> wrote:
> 
> On 25/02/2022 04:11, Alejandro Pérez Carballo wrote:
>> Thanks for your reply. I can store the ID calling `org-store-link'
>> if `org-id-link-to-org-use-id' is set to a non-nil value. But I wanted to be able to have `org-id-link-to-org-use-id' set to nil and
>> also have a function to store an ID link. (I make use of ID only in
>> certain files and try to avoid them otherwise, preferring the default
>> method of using a link to the file with a search string pointing to
>> the current line in most cases.)
> 
> I have no idea what interface `org-store-link' should have to be really flexible and convenient.
> 
> Have you considered file- (or directory-) local variables?
> info "(emacs) Specifying File Variables"
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html
> 
> # Local Variables:
> # org-id-link-to-org-use-id: use-existing
> # End:
> 
> at the end of specific files.
> 
>> I had expected that `org-insert-link' would be able to retrieve links stored both with `org-store-link' and `org-id-store-link'—it
>> seemed like a natural assumption, perhaps because I do not know of
>> other reasons for having an interactive function that stores links
>> aside from being able to insert them later?
> I can not say that I am happy with implementation of `org-store-link' or that I fully understand ideas behind ol.el. I just found an example of `org-id-store-link' usage:
> https://git.sr.ht/~bzg/org-contrib/tree/master/item/lisp/org-contacts.el#L1171
> see definition of "org-contact" link a bit above as well.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-25 18:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-17 23:26 Inserting links stored in `org-store-link-plist` Alejandro Pérez Carballo
2022-02-23 15:50 ` Max Nikulin
2022-02-24 21:11   ` Alejandro Pérez Carballo
2022-02-25 16:25     ` Max Nikulin
2022-02-25 17:21       ` Alejandro Pérez Carballo

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.