On Wed, Nov 5, 2025 at 8:35 PM Ihor Radchenko <[email protected]> wrote:
>
> ja fro <[email protected]> writes:
>
> > This top-level property format works for both, org-attach and org-id.
> > ```
> > :PROPERTIES:
> > :ID:       <timestamp-identifier>
> > :END:
> > ```
> >
> > This top-level property format works for org-attach only.
> > `#+property: ID <timestamp-identifier>`
> >
> > I don't know if it is intended behavior/bug/undocumented case. In my case I
> > prefer the one-line form because it is shorter and I don't use other
> > properties besides ID.
>
> The two cases are not the same.
> In the first case (with property drawer), you assign an ID to your Org
> document. That ID is not inherited by headings.
>
> In the second case (with #+property line, you are setting _default
> inherited value_ of IDs for everything, including whole document and also each
> heading.

Thanks for the precise explanation. I see the difference.

> By default, Org mode only looks into immediate ID (not inherited), when
> creating ID links. If a heading has an ID - id link is created. If a
> heading does not have an ID, file link is created. The same applies to
> text before first heading - top-level PROPERTIES drawer is considered as
> 0th heading property that own 0th section (text before first heading).
> If there is no ID is PROPERTIES drawer, id link is correspondingly not
> created.
>
> If you want inherited IDs to be used for id: link creation, you need to
> enable `org-id-link-consider-parent-id', which see.

Well I already have enabled `org-id-link-consider-parent-id` but the
links do not work when using one-line definition of ID (the second
case)
I have checked the function ` org-id-update-id-locations` which
collects IDs and populate `.orgids` database and it seems to me it
ignores the one-line definition of ID. It looks only for `:ID:` regexp
I think (if it is false alarm I am sorry I am still elisp beginner).
```
         (id-regexp
      (rx (seq bol (0+ (any "\t ")) ":ID:" (1+ " ") (not (any " ")))))
         (seen-ids (make-hash-table :test #'equal))
```

Regards Jaroslav

Reply via email to