emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Link descriptions in org-element parser
@ 2017-05-21 21:35 Erik Sjöstrand
  2017-05-21 23:11 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Sjöstrand @ 2017-05-21 21:35 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

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.

I'm using org-mode 9.0.5 on Emacs 25.2.1.

[-- Attachment #2: Type: text/html, Size: 636 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: Link descriptions in org-element parser
  2017-05-21 21:35 Bug: Link descriptions in org-element parser Erik Sjöstrand
@ 2017-05-21 23:11 ` Nicolas Goaziou
  2017-05-22  7:51   ` Erik Sjöstrand
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2017-05-21 23:11 UTC (permalink / raw)
  To: Erik Sjöstrand; +Cc: emacs-orgmode

Hello,

Erik Sjöstrand <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:
>
>     [[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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: Link descriptions in org-element parser
  2017-05-21 23:11 ` Nicolas Goaziou
@ 2017-05-22  7:51   ` Erik Sjöstrand
  2017-05-22 11:37     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Sjöstrand @ 2017-05-22  7:51 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

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 <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Erik Sjöstrand <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:
> >
> >     [[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
>

[-- Attachment #2: Type: text/html, Size: 2327 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: Link descriptions in org-element parser
  2017-05-22  7:51   ` Erik Sjöstrand
@ 2017-05-22 11:37     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2017-05-22 11:37 UTC (permalink / raw)
  To: Erik Sjöstrand; +Cc: emacs-orgmode

Hello,

Erik Sjöstrand <sjostrand.erik@gmail.com> writes:

> 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.

Then it was probably fixed in master branch, i.e., development version.
At least I cannot reproduce it. The fix will be included in Org 9.1.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-22 11:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-21 21:35 Bug: Link descriptions in org-element parser Erik Sjöstrand
2017-05-21 23:11 ` Nicolas Goaziou
2017-05-22  7:51   ` Erik Sjöstrand
2017-05-22 11:37     ` Nicolas Goaziou

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).