From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug, patch, ox] INCLUDE and footnotes Date: Mon, 22 Dec 2014 23:51:37 +0100 Message-ID: <878uhz47t2.fsf@nicolasgoaziou.fr> 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> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3BoO-0005DV-SR for emacs-orgmode@gnu.org; Mon, 22 Dec 2014 17:50:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3BoG-0006a9-Of for emacs-orgmode@gnu.org; Mon, 22 Dec 2014 17:50:48 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:35493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3BoG-0006Zl-6q for emacs-orgmode@gnu.org; Mon, 22 Dec 2014 17:50:40 -0500 In-Reply-To: <87vbl3z65i.fsf@gmx.us> (rasmus@gmx.us's message of "Mon, 22 Dec 2014 23:11: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: Rasmus Cc: emacs-orgmode@gnu.org 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). Anyway, it doesn't matter much. The marker is fine, indeed. > Since it's soon Christmas, so I could perhaps accommodate. I ensure you I have mostly been kind all year long. > + (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? Also, BEGINNING should refer to (nth 1 definition) since you're not using `org-footnote-goto-definition' and therefore, not moving point. I think you can push once the issues above are fixed. Thank you for the work. Regards,