emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Johan Tolö" <johan@toloe.se>
Cc: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87ftdhc16e.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87imigzzdy.fsf@toloe.se> ("Johan Tolö"'s message of "Fri, 03 Apr 2020 11:34:17 +0200")

Hello,

Johan Tolö <johan@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


  reply	other threads:[~2020-04-05 18:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03  9:34 Why is `org-element-affiliated-keywords' a var when `org-element--affiliated-re' is a const? Johan Tolö
2020-04-05 17:06 ` Nicolas Goaziou [this message]
2020-04-05 21:01   ` Johan Tolö

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ftdhc16e.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=johan@toloe.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).