[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why is `org-element-affiliated-keywords' a var when `org-element--af
From: |
Nicolas Goaziou |
Subject: |
Re: Why is `org-element-affiliated-keywords' a var when `org-element--affiliated-re' is a const? |
Date: |
Sun, 05 Apr 2020 19:06:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hello,
Johan Tolö <address@hidden> 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