emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Bug] org-store-link should not insert a document level ID property
@ 2020-04-04 22:13 Matt Lundin
  2020-04-04 23:07 ` Gustav Wikström
  0 siblings, 1 reply; 12+ messages in thread
From: Matt Lundin @ 2020-04-04 22:13 UTC (permalink / raw)
  To: Org Mode List; +Cc: Gustav Wikström

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?

Best,
Matt


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

end of thread, other threads:[~2020-05-14 22:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-04 22:13 [Bug] org-store-link should not insert a document level ID property Matt Lundin
2020-04-04 23:07 ` Gustav Wikström
2020-04-05 15:50   ` Gustav Wikström
2020-04-10  8:08     ` Gustav Wikström
2020-05-07 21:41     ` Matthew Lundin
2020-05-13  8:33       ` Nicolas Goaziou
2020-05-13 13:26         ` Matthew Lundin
2020-05-13 16:45           ` Nicolas Goaziou
2020-05-14 19:27             ` Gustav Wikström
2020-05-14 21:20               ` Nicolas Goaziou
2020-05-14 22:06                 ` Gustav Wikström
2020-05-14 19:11       ` Gustav Wikström

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).