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 17:05:26 -0500 Message-ID: References: <87k3084h9s.fsf@nicolasgoaziou.fr> <87d26046yr.fsf@nicolasgoaziou.fr> <87zj933o1e.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGEGM-0000V5-Ps for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 17:05:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGEGH-0000Rm-OU for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 17:05:34 -0500 Received: from mail-qa0-x231.google.com ([2607:f8b0:400d:c00::231]:63688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGEGH-0000Rg-JE for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 17:05:29 -0500 Received: by mail-qa0-f49.google.com with SMTP id v8so13497367qal.8 for ; Tue, 27 Jan 2015 14:05:29 -0800 (PST) In-reply-to: <87zj933o1e.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. It looks like `org-element-secondary-p' is upstream of my org version (8.2.10) but I look forward to seeing it work in the future! BTW, the application of this is in checking cite/ref/label links for correctness in org-buffers. It is not uncommon to have these in figure/table captions. I was mapping over all of them and collecting the positions to make a clickable buffer to go straight to the bad links (e.g the ones with no bibtex entries, or that ref a non-existent label, or that have multiply defined labels). It is pretty amazing what is possible with this machinery! Best wishes, Nicolas Goaziou writes: > John Kitchin writes: > >> hmm... Is there any way to tell when a link in in an affiliate? so we >> can tell when we cannot trust buffer positions? > > There is `org-element-secondary-p'. > >> Maybe even better fix the implementation to add the found buffer >> positions to some affiliate position so they are correct? > > This is not always possible: some strings are parsed when the original > buffer is not available anymore (this happens often during export). > > However, it is possible to fix it for captions. I did it in master. > > > 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