From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [bug, patch, ox] INCLUDE and footnotes Date: Tue, 23 Dec 2014 03:09:33 +0100 Message-ID: <87lhlzyv4y.fsf@gmx.us> References: <87h9x5hwso.fsf@gmx.us> <87oarcbppe.fsf@nicolasgoaziou.fr> <87fvcozfhf.fsf@gmx.us> <87h9x4bj33.fsf@nicolasgoaziou.fr> <87iohks4ne.fsf@gmx.us> <87d27rbvio.fsf@nicolasgoaziou.fr> <87bnnbhg2x.fsf@gmx.us> <878uifbjc7.fsf@nicolasgoaziou.fr> <87388j9qbv.fsf@gmx.us> <87y4q57t2i.fsf@nicolasgoaziou.fr> <87lhm4n9ky.fsf@pank.eu> <87mw6gyctg.fsf@nicolasgoaziou.fr> <87lhm01mj7.fsf@gmx.us> <87wq5kvt2g.fsf@nicolasgoaziou.fr> <8761d32759.fsf@gmx.us> <87h9wn4d8r.fsf@nicolasgoaziou.fr> <87vbl3z65i.fsf@gmx.us> <878uhz47t2.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3Euw-0007Z9-IJ for emacs-orgmode@gnu.org; Mon, 22 Dec 2014 21:09:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3Eur-0000xW-3H for emacs-orgmode@gnu.org; Mon, 22 Dec 2014 21:09:46 -0500 Received: from mout.gmx.net ([212.227.15.19]:53061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3Euq-0000x9-OS for emacs-orgmode@gnu.org; Mon, 22 Dec 2014 21:09:41 -0500 Received: from W530 ([109.201.152.243]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MPlsg-1XzPAQ30bq-0053bl for ; Tue, 23 Dec 2014 03:09:37 +0100 In-Reply-To: <878uhz47t2.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 22 Dec 2014 23:51:37 +0100") 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: emacs-orgmode@gnu.org Hi, Nicolas Goaziou writes: > Rasmus writes: > >>>> * Foo >>>> [1] foo >>>> >>>> * Bar >>>> Baz[1] >>> >>> I'm not sure to understand. Would you mind elaborating? >> >> If I have #+INCLUDE: "example-above.org::*Bar" then point-min of the >> include area will be pushed forward by four since the definition of [1] = is >> changed to fn:1-1 or something like that. So min-marker should be a >> marker. Or I'm misunderstanding something. > > No, you're right. However, this raises a question: why are we modifying > definition at all? We are only interested in its new label, which we can > get without modifying buffer (i.e. if definition is within range, modify > it, otherwise, compute new label and store its definition). We modify buffer because that's what we want to do when including whole files. The routines /could/ be split up, I just deemed it "not worth the trouble". Operations on the table are of course limited to when it's needed. Buffer-editing is not. It's simple to wrap it in an if-statement if you think it's worth it, e.g. performance-wise. I'd only need to move the catching of new-label back to the footnote-reference. >> + (org-with-wide-buffer >> + (let* ((definition (org-footnote-get-definition label)) >> + (beginning (line-beginning-position))) > There's one potential problem here: `org-footnote-get-definition' may > return a nil value if there is no matching definition for label. Maybe > throw an error? Ox already throws an error when a footnote is not found in org-export-get-footnote-definition which is why I didn't add this. But I guess it would be friendly to add another error here stating which *file* is missing a footnote and I added this now. > Also, BEGINNING should refer to (nth 1 definition) since you're not > using `org-footnote-goto-definition' and therefore, not moving point. Indeed. Thanks. > I think you can push once the issues above are fixed. Thank you for the > work. Cool. I think the #+INCLUDE-keyword is quite a bit better in 8.3 now and. Thanks for all the help on this series of patches (I think four in total)! =E2=80=94Rasmus --=20 However beautiful the theory, you should occasionally look at the evidence