emacs-orgmode
[Top][All Lists]
Advanced

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

RE: [Bug] org-store-link should not insert a document level ID property


From: Gustav Wikström
Subject: RE: [Bug] org-store-link should not insert a document level ID property
Date: Fri, 10 Apr 2020 08:08:50 +0000

Hi,

Just wanted to say that the patch is applied on master. It's solving the 
problem. Regarding user-configuration that can be added later if needed. It's 
not wrong right now per se.

Cheers!
Gustav

> -----Original Message-----
> From: Gustav Wikström
> Sent: den 5 april 2020 17:50
> To: Matt Lundin <address@hidden>; Org Mode List <address@hidden>
> Subject: RE: [Bug] org-store-link should not insert a document level ID
> property
> 
> Hi again,
> 
> Patch is attached. It's not applied yet as it doesn't include anything about
> user-configuration yet. @Matt Lundin, care to elaborate what you had in mind
> in terms of that?
> 
> With this patch a link before first headline is stored with the filename (no
> path) as description. Following the link does what you'd expect. Tests ran
> fine with the patch applied.
> 
> Regards
> Gustav
> 
> > Hi,
> >
> > > -----Original Message-----
> > > From: Matt Lundin <address@hidden>
> > > Sent: den 5 april 2020 00:13
> > > To: Org Mode List <address@hidden>
> > > Cc: Gustav Wikström <address@hidden>
> > > Subject: [Bug] org-store-link should not insert a document level ID
> property
> > >
> > > The introduction of document-level property drawers (commit
> > > 1bdff9f73dc1e7ff625a90e3e61350bdea99f29c from May 2019) introduced
> > > inconsistencies in the behavior of org-id and org-store-link.
> > >
> > > If org-id-link-to-org-use-id is set to t or 'create-if-interactive,
> > > calling org-store-link above the first headline in an org file will
> > > insert a PROPERTY drawer and an ID at top of the file, so that the file
> > > (call it "~/test.org") looks like this:
> > >
> > > --8<---------------cut here---------------start------------->8---
> > > :PROPERTIES:
> > > :ID:       1f43e860-9e7b-4c8f-82b9-6ed3352e589f
> > > :END:
> > >
> > > * First headline
> > > --8<---------------cut here---------------end--------------->8---
> > >
> > > However, the link that Org actually stores is "[[file:~/test.org]]", so
> > > the ID is irrelevant.
> > >
> > > In addition, a link to a document-level ID does not work. Following
> > > "[[id:1f43e860-9e7b-4c8f-82b9-6ed3352e589f]]" results in this error:
> > >
> > > user-error: Before first headline at position 14 in buffer test.org
> > >
> > > So either:
> > >
> > > 1. org-id and org-store-link/org-open-link should support document level
> > >    ids in a user-configurable way, or
> > > 2. org-id-get-create should detect whether it is above the first heading
> > >    and should not create an id
> > >
> > > Option #2 would obviously be the easier fix.
> > >
> > > Gustav: were IDs within the scope of your initial thinking about
> > > document level properties? Or are these largely irrelevant?
> >
> > Yes, they were in scope and ID should mean something also before first
> > headline. I'll have a look to see what can be done. Thanks for finding
> this!
> >
> > >
> > > Best,
> > > Matt

reply via email to

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