From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Preserving links when using org-element-interpret-data Date: Sun, 09 Oct 2016 09:44:35 +0200 Message-ID: <8737k6kluk.fsf@nicolasgoaziou.fr> References: <87vax62jx5.fsf@dell-desktop.WORKGROUP> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bt8mk-0000RA-UB for emacs-orgmode@gnu.org; Sun, 09 Oct 2016 03:44:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bt8mh-0004Hl-Oo for emacs-orgmode@gnu.org; Sun, 09 Oct 2016 03:44:38 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:49005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bt8mh-0004G7-Hd for emacs-orgmode@gnu.org; Sun, 09 Oct 2016 03:44:35 -0400 In-Reply-To: <87vax62jx5.fsf@dell-desktop.WORKGROUP> (Thibault Marin's message of "Wed, 05 Oct 2016 23:14:30 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Thibault Marin Cc: emacs-orgmode@gnu.org Hello, Thibault Marin 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