From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: [bug, patch, ox] INCLUDE and footnotes
Date: Tue, 23 Dec 2014 03:09:33 +0100 [thread overview]
Message-ID: <87lhlzyv4y.fsf@gmx.us> (raw)
In-Reply-To: <878uhz47t2.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 22 Dec 2014 23:51:37 +0100")
Hi,
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> Rasmus <rasmus@gmx.us> 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)!
—Rasmus
--
However beautiful the theory, you should occasionally look at the evidence
next prev parent reply other threads:[~2014-12-23 2:09 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 11:44 [bug, patch, ox] INCLUDE and footnotes Rasmus
2014-12-09 19:10 ` Rasmus
2014-12-09 19:14 ` Nicolas Goaziou
2014-12-09 21:21 ` Rasmus
2014-12-09 21:37 ` Nicolas Goaziou
2014-12-10 0:57 ` Rasmus
2014-12-10 11:21 ` Nicolas Goaziou
2014-12-10 11:58 ` Rasmus
2014-12-10 15:44 ` Nicolas Goaziou
2014-12-13 21:45 ` Rasmus
2014-12-17 23:30 ` Nicolas Goaziou
2014-12-18 17:37 ` Rasmus
2014-12-19 16:44 ` Rasmus
2014-12-21 21:04 ` Nicolas Goaziou
2014-12-21 22:39 ` Rasmus
2014-12-21 23:38 ` Nicolas Goaziou
2014-12-22 1:42 ` Rasmus
2014-12-22 9:05 ` Nicolas Goaziou
2014-12-24 18:03 ` Rasmus
2014-12-24 21:14 ` Nicolas Goaziou
2014-12-25 1:38 ` Rasmus
2014-12-25 2:04 ` Rasmus
2014-12-21 20:52 ` Nicolas Goaziou
2014-12-22 1:49 ` Rasmus
2014-12-22 11:10 ` Nicolas Goaziou
2014-12-22 12:36 ` Rasmus
2014-12-22 20:54 ` Nicolas Goaziou
2014-12-22 22:11 ` Rasmus
2014-12-22 22:51 ` Nicolas Goaziou
2014-12-23 2:09 ` Rasmus [this message]
2014-12-24 17:54 ` Rasmus
2014-12-24 18:10 ` [git-101] How to push a branch and avoid merge-message? (was: [bug, patch, ox] INCLUDE and footnotes) Rasmus
2014-12-24 21:09 ` [git-101] How to push a branch and avoid merge-message? Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhlzyv4y.fsf@gmx.us \
--to=rasmus@gmx.us \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).