emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Richard Lawrence <richard.lawrence@berkeley.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: Multicite syntax
Date: Tue, 17 Mar 2015 20:59:33 +0100	[thread overview]
Message-ID: <87a8zb2y56.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87oanr1slm.fsf@berkeley.edu> (Richard Lawrence's message of "Tue, 17 Mar 2015 09:44:37 -0700")

Hello,

Richard Lawrence <richard.lawrence@berkeley.edu> writes:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

>> You could do the following
>>
>>   (let ((citation (org-element-lineage (org-element-context) '(citation) t))
>>         references)
>>     (save-excursion
>>       (goto-char (org-element-property :contents-begin citation))
>>       (let ((end (org-element-property :contents-end citation)))
>>         (while (< (point) end)
>>           (let ((reference (org-element-lineage
>>                             (org-element-context) '(citation-reference) t))))
>>           (push reference references)
>>           (goto-char (org-element-property :end reference)))))
>>     (nreverse references))
>
> Thanks!

For correctness, (push ...) and (goto-char ...) obviously need to be
located within the (let ...).

> Just to clarify: I see that this is necessary when getting a citation
> object via org-element-context, but is it also necessary in an export
> context, where the whole buffer or region has already been parsed?

No, with a full parse tree, `org-element-contents' on a citation object
returns the list of all citation-reference objects within.

> I ask because in that kind of context, I think it is generally going to
> be more useful to deal with citation objects as a whole.  I am not sure
> we will want to treat citation-references as individual objects which
> are themselves exported; instead, I think we will want to handle
> exporting the citation-references in a citation all at once.

I don't know. In any case, they need to be treated as regular object
(e.g., they are expected to have a filter associated to them).

If some back-end doesn't need to export directly citation references, it
just needs to skip the relative translator.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2015-03-17 20:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08  6:29 Multicite syntax Vaidheeswaran C
2015-03-08 11:21 ` Vaidheeswaran C
2015-03-08 16:28 ` Nicolas Goaziou
2015-03-10  9:03   ` Vaidheeswaran C
2015-03-14 16:17   ` Richard Lawrence
2015-03-14 22:20     ` Nicolas Goaziou
2015-03-17 16:44       ` Richard Lawrence
2015-03-17 19:59         ` Nicolas Goaziou [this message]
2015-03-18 16:13           ` Richard Lawrence

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=87a8zb2y56.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=richard.lawrence@berkeley.edu \
    /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).