emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Thibault Marin <thibault.marin@gmx.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Preserving links when using org-element-interpret-data
Date: Sun, 09 Oct 2016 09:44:35 +0200	[thread overview]
Message-ID: <8737k6kluk.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87vax62jx5.fsf@dell-desktop.WORKGROUP> (Thibault Marin's message of "Wed, 05 Oct 2016 23:14:30 -0500")

Hello,

Thibault Marin <thibault.marin@gmx.com> writes:

> I am trying to use the org-element tools to modify an org file from elisp code
> and I was wondering if the `org-element-parse-buffer' /
> `org-element-interpret-data' combo should result in the same content as the
> original buffer.

There is no guarantee that they return the same original buffer.
Actually, it is highly unlikely. Some information, not useful to Org, is
ignored during parsing (e.g., global indentation, case for keywords...).

However, they will return an equivalent buffer, in the sense that both
the produced and the original one have the same parse tree.

> I am having issues with links where the target and the
> description are both =file:= entries.

[...]

> The input link is transformed from
>
> #+begin_example
> [[file:a.png][file:a.png]]
> #+end_example
>
> to
>
> #+begin_example
> [[file:a.png][[[file:a.png]]]]
> #+end_example
>
> Are the additional brackets in the description expected?

No, this is a genuine bug. This is now fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

      reply	other threads:[~2016-10-09  7:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06  4:14 Preserving links when using org-element-interpret-data Thibault Marin
2016-10-09  7:44 ` Nicolas Goaziou [this message]

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=8737k6kluk.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=thibault.marin@gmx.com \
    /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).