From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: question about org-element-map missing link in caption Date: Tue, 27 Jan 2015 08:48:52 -0500 Message-ID: References: <87k3084h9s.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG6Vq-0005Df-Le for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 08:49:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YG6Vl-0003oV-CS for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 08:49:02 -0500 Received: from mail-qc0-x22b.google.com ([2607:f8b0:400d:c01::22b]:38391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG6Vl-0003oR-8D for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 08:48:57 -0500 Received: by mail-qc0-f171.google.com with SMTP id s11so12006068qcv.2 for ; Tue, 27 Jan 2015 05:48:56 -0800 (PST) In-reply-to: <87k3084h9s.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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org, John Kitchin 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 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