From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [patch] more robust footnotes Date: Wed, 25 May 2016 19:51:19 +0200 Message-ID: <87h9dmvxew.fsf@gmx.us> References: <1461444845.13483.6.camel@gmail.com> <87h9eqt74z.fsf@gmx.us> <87a8kivzcc.fsf@saiph.selenimh> <87r3durmc6.fsf@gmx.us> <87h9ep6hkx.fsf@saiph.selenimh> <874mapstdk.fsf@gmx.us> <87a8kh4wpp.fsf@saiph.selenimh> <87r3ctalx7.fsf@gmx.us> <87bn3w8nba.fsf@saiph.selenimh> <87k2ij895o.fsf_-_@gmx.us> <87h9dn87nn.fsf@saiph.selenimh> <87eg8r6srw.fsf@gmx.us> <87d1ob86m2.fsf@saiph.selenimh> <8737p6fw0a.fsf@gmx.us> <871t4q84k7.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5cxz-0007XO-Vl for emacs-orgmode@gnu.org; Wed, 25 May 2016 13:51:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5cxu-00087W-4n for emacs-orgmode@gnu.org; Wed, 25 May 2016 13:51:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:47533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5cxt-00087N-UF for emacs-orgmode@gnu.org; Wed, 25 May 2016 13:51:30 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b5cxr-0003pi-KU for emacs-orgmode@gnu.org; Wed, 25 May 2016 19:51:27 +0200 Received: from ip-178-203-233-130.hsi10.unitymediagroup.de ([178.203.233.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 May 2016 19:51:27 +0200 Received: from rasmus by ip-178-203-233-130.hsi10.unitymediagroup.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 May 2016 19:51:27 +0200 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Rasmus writes: > >> Nicolas Goaziou writes: >>> >>> I suggest to avoid calling repeatedly >>> `org-export-get-footnote-definition'. Also, if the footnote reference is >>> anonymous, there is no point in calling `org-element-map'. The following >>> is more efficient: >>> >>> (format "\\footnote{%s%s}" >>> (org-trim (org-export-data def info)) >>> ;; Only insert a label if there exist another reference to def. >>> (cond >>> ((not label) "") >>> ((org-element-map (plist-get info :parse-tree) 'footnote-reference >>> (lambda (f) >>> (and (not (eq f footnote-reference)) >>> (equal (org-element-property :label f) label) >>> (org-latex--label def info t t))) >>> info t)) >>> (t ""))) >> >> Thanks. >> >> I have pushed the change. > > Thank you. > > However, the patch you committed doesn't short-circuit on anonymous > footnotes, per above (the (not label) part). As a consequence, every > anonymous footnote (as long as there is more than one) gets a label, > AFAICT. You are right. I missed that case. I've pushed your suggested fix. Rasmus -- Spil noget med Slayer!