emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Feature request: IDs for everything


From: Ihor Radchenko
Subject: Re: Feature request: IDs for everything
Date: Sat, 21 Oct 2023 13:05:35 +0000

Tor Erlend Fjelde <tor.github@gmail.com> writes:

> I was wondering if there's a reason why we couldn't have IDs a la
> org-id.el for everything? It seem to me that it would be useful to use
> something like `#+ID` in place of `#+NAME` for tables, blocks, etc. as
> well as headlines.

This has been discussed in the past.

Apart from #+NAME, we also have radio <<<targets>>> that can be used a
link anchors (#+NAME or other affiliated keywords are not allowed, for
example, in items).

We also discussed linking to #+name and <<<target>>> globally, without
specifying the file path.

> Would this go against the intended design of
> org-id.el, or is this a change that would be welcome but that no one
> has gotten around to implementing yet?

Mostly nobody has gotten around.

Although we have at least one caveat that we need to consider - the
current users of the id: links blindly assume that they always link to
headings. This includes many third-party packages, like org-roam.

If we simply allow id: links to point to non-headings, it will be a
major breaking change that may affect third-party packages. So, we
need to design the extended ids carefully to avoid breakage. For
example, `org-id-find' and other API function may need to work in two
modes: (1) legacy, only searching for headings; (2) new, searching for
anything. This can, for example, be done via an extra optional argument.

-----

As an alternative option, we had a proposal that extends id: links to
have a search option:

 [[id:<ID>:search-string]]

Then, we may have top-level drawer like

:PROPERTIES:
:ID: unique-file-id
:END:

And then refer to anything inside the file as

 [[id:unique-file-id:object-id-inside-the-file]]

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