[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] org-id: allow using parent's existing id in links to headlines
From: |
Rick Lupton |
Subject: |
[PATCH] org-id: allow using parent's existing id in links to headlines |
Date: |
Mon, 24 Jul 2023 12:40:54 +0100 |
User-agent: |
Cyrus-JMAP/3.9.0-alpha0-531-gfdfa13a06d-fm-20230703.001-gfdfa13a0 |
Hi,
Here is a small new feature for org-id that I have been using and finding
useful. The patch adds the option to look for ancestors of the current headline
that have an ID defined and use that together with a link search string to link
to specific headlines, without needing every single headline to have its own ID.
For example if you have:
#+begin_example
* H1
:PROPERTIES:
:ID: abc
:END:
** H2
<point>Link to here
#+end_example
with `org-id-link-to-org-use-id' set to `t`, the result of org-store-link will
be that "H2" has a new id generated, and the link is to that new ID:
`[[id:new-id][H2]]`.
Now, with `org-id-link-to-org-use-id' set to `inherit`, "H2" is not modified,
and the resulting link is `[[id:abc::*H2][H2]]`, which will still take you to
the same place as long as the sub-heading is unique within the parent heading
with an ID.
As an example, I find this useful in situations like this:
#+begin_example
* Project 1
:PROPERTIES:
:ID: project-1
:END:
** <2023-07-01> Meeting A
** <2023-07-08> Meeting B
** <2023-07-15> Meeting C
#+end_example
... so that I can link to specific meetings without needing every one to have
its own org ID.
Feedback on the patch welcome. If you would like to merge this I will (I
assume) need to sort out FSF copyright assignment and update ORG-NEWS and the
manual.
Best
Rick
0001-lisp-org-id.el-Allow-using-a-parent-s-existing-id.patch
Description: Binary data
- [PATCH] org-id: allow using parent's existing id in links to headlines,
Rick Lupton <=
- Re: [PATCH] org-id: allow using parent's existing id in links to headlines, Ihor Radchenko, 2023/07/25
- Re: [PATCH] org-id: allow using parent's existing id in links to headlines, Max Nikulin, 2023/07/25
- Re: [PATCH] org-id: allow using parent's existing id in links to headlines, Ihor Radchenko, 2023/07/26
- Re: [PATCH] org-id: allow using parent's existing id in links to headlines, Samuel Wales, 2023/07/26
- IDs below headline level (for paragraphs, lists, etc) (was: [PATCH] org-id: allow using parent's existing id in links to headlines), Ihor Radchenko, 2023/07/27
- Re: IDs below headline level (for paragraphs, lists, etc) (was: [PATCH] org-id: allow using parent's existing id in links to headlines), Rick Lupton, 2023/07/28
- Re: [PATCH] org-id: allow using parent's existing id in links to headlines, Rick Lupton, 2023/07/28
- Re: [PATCH] org-id: allow using parent's existing id in links to headlines, Ihor Radchenko, 2023/07/29