Hello, Johan Tolö <jo...@toloe.se> writes:
> Dear all, > > I want to add my own org-element affiliated keyword "REF" in order > to provide a reference to some other part of an org mode document > (or another document) for a link. > > For example: > > #+NAME: a-figure > #+REF: [[file:another_document.org]] > > [[file:a-figure.png]] > > I want to use `org-element-context' to get the link element and > use `org-element-property' to get the `REF' property. > > I tried changing `org-element-affiliated-keywords' in order to > define my own keyword. This is never picked up by > `org-element-context' since it uses `org-element--affiliated-re' > which is defined as a const and thus is never updated to reflect > the change to `org-element-affiliated-keywords'. The help text for > `org-element--affiliated-re' even mentions changing > `org-element-affiliated-keywords'. > > Is this an oversight or am I trying to use this is a way that is > not intended? Syntax is not meant to be changed by users. Also, `org-element-affiliated-keywords' is a defconst. You might abuse #+header: affiliated keyword to add a reference. Regards, -- Nicolas Goaziou