From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Erik_Sj=C3=B6strand?= Subject: Re: Bug: Link descriptions in org-element parser Date: Mon, 22 May 2017 07:51:57 +0000 Message-ID: References: <87y3tphkka.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c037632e171160550182508" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCi8Q-0001Or-NS for emacs-orgmode@gnu.org; Mon, 22 May 2017 03:52:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCi8P-0000VK-K7 for emacs-orgmode@gnu.org; Mon, 22 May 2017 03:52:10 -0400 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]:33717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dCi8P-0000VB-Ds for emacs-orgmode@gnu.org; Mon, 22 May 2017 03:52:09 -0400 Received: by mail-oi0-x22a.google.com with SMTP id w10so151605934oif.0 for ; Mon, 22 May 2017 00:52:09 -0700 (PDT) In-Reply-To: <87y3tphkka.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org --94eb2c037632e171160550182508 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi! I've updated to org-mode 9.0.7 but the problem remains. With this org-mode buffer [[info:emacs#Directory%20variables][info:Directory variables]] org-element-parse-buffer give the following (indented): (org-data nil (section (:begin 1 :end 92 :contents-begin 1 :contents-end 92 :post-blank 0 :post-affiliated 1 :parent #0) (paragraph (:begin 1 :end 65 :contents-begin 1 :contents-end 64 :post-blank 1 :post-affiliated 1 :parent #1) (link (:type info :path emacs#Directory%20variables :format bracket :raw-link info:emacs#Directory%20variables :application nil :search-option nil :begin 1 :end 63 :contents-begin 37 :contents-end 61 :post-blank 0 :parent #2) (link (:type info :path Directory :format plain :raw-link info:Directory :application nil :search-option nil :begin 37 :end 52 :contents-begin nil :contents-end nil :post-blank 1 :parent #3)) variables)))) So the org-element-contents of the link is another link. On Mon, May 22, 2017 at 1:11 AM Nicolas Goaziou wrote: > Hello, > > Erik Sj=C3=B6strand writes: > > > When having an link where the link's description also look like a link, > > the description will be treated like a link by org-element. As an > > example: > > > > [[info:emacs#Directory%20Variables][info:Directory Variables]] > > > > If the above was an org-file, org-element-parse-buffer would find two > > links in the buffer, but the above is really just one link even though > > its description look like a link. A consequence of this is that the > > org-element-contents of the link above would be another link, which can > > cause bugs. > > IIRC, this was fixed a while ago. You may want to update Org. > > Regards, > > -- > Nicolas Goaziou > --94eb2c037632e171160550182508 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!

I've updated to org-mo= de 9.0.7 but the problem remains. With this org-mode buffer

=C2=A0= =C2=A0=C2=A0 [[info:emacs#Directory%20variables][info:Directory variables]]=

org-element-parse-buffer give the following (indented):
(org-data
=C2=A0nil
=C2=A0(section
=C2=A0 (:begin 1 :end 92 :con= tents-begin 1 :contents-end 92 :post-blank 0 :post-affiliated 1 :parent #0)=
=C2=A0 (paragraph
=C2=A0=C2=A0 (:begin 1 :end 65 :contents-begin 1 := contents-end 64 :post-blank 1 :post-affiliated 1 :parent #1)
=C2=A0=C2= =A0 (link
=C2=A0=C2=A0=C2=A0 (:type info :path emacs#Directory%20variabl= es :format bracket :raw-link info:emacs#Directory%20variables :application = nil :search-option nil :begin 1 :end 63 :contents-begin 37 :contents-end 61= :post-blank 0 :parent #2)
=C2=A0=C2=A0=C2=A0 (link (:type info :path Di= rectory :format plain :raw-link info:Directory :application nil :search-opt= ion nil :begin 37 :end 52 :contents-begin nil :contents-end nil :post-blank= 1 :parent #3))
=C2=A0=C2=A0=C2=A0 variables))))

So the org= -element-contents of the link is another link.


On Mon, May 22, 2017= at 1:11 AM Nicolas Goaziou <m= ail@nicolasgoaziou.fr> wrote:
sjostrand.erik@gmail.com> writes:

> When having an link where the link's description also look like a = link,
> the description will be treated like a link by org-element. As an
> example:
>
>=C2=A0 =C2=A0 =C2=A0[[info:emacs#Directory%20Variables][info:Directory = Variables]]
>
> If the above was an org-file, org-element-parse-buffer would find two<= br> > links in the buffer, but the above is really just one link even though=
> its description look like a link. A consequence of this is that the > org-element-contents of the link above would be another link, which ca= n
> cause bugs.

IIRC, this was fixed a while ago. You may want to update Org.

Regards,

--
Nicolas Goaziou
--94eb2c037632e171160550182508--