emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] question about org-element-map missing link in caption


From: John Kitchin
Subject: Re: [O] question about org-element-map missing link in caption
Date: Tue, 27 Jan 2015 08:48:52 -0500

Thanks that is what I needed!

I tried it, and indeed the links in captions are found, but something is
still not right. The :begin properties of the links in the caption seem
to be relative to the point after the : in the caption. That isn't
obvious and makes it hard to store a marker to the link. Is that
expected behavior?

* test links

#+caption: some text label:test3  cite:needs-1989-cal
| a | b |
| 1 | 3 |

 citenum:needs-1989-calcu

#+BEGIN_SRC emacs-lisp :results code
(org-element-map (org-element-parse-buffer) 'link
  (lambda (link)
    (cons
     (org-element-property :path link)
     (org-element-property :begin link)))
  nil nil nil t)
#+END_SRC
#+RESULTS:
#+BEGIN_SRC emacs-lisp
(("test3" . 11)
 ("needs-1989-cal" . 24)
 ("needs-1989-calcu" . 91))
#+END_SRC

(goto-char 11) This goes into the headline

(goto-char 24) This goes to the : in the caption

(goto-char 91)  This goes exactly where I expect


Nicolas Goaziou writes:

> Hello,
>
> John Kitchin <address@hidden> writes:
>
>> In the following org document, org-element-map only finds one link, but
>> the buffer acts like there are two links. The free link is found, but
>> the link label buried in the caption is not found. However, it exports
>> correctly, and the caption link is clickable, so the buffer certainly
>> thinks it is a link. Is this expected behavior?
>
> It is. By default, `org-element-map' doesn't look into captions. See
> WITH-AFFILIATED optional argument.
>
>
> Regards,

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]