From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [bug, patch, ox] INCLUDE and footnotes
Date: Mon, 22 Dec 2014 21:54:12 +0100 [thread overview]
Message-ID: <87h9wn4d8r.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <8761d32759.fsf@gmx.us> (rasmus@gmx.us's message of "Mon, 22 Dec 2014 13:36:34 +0100")
Thanks for the update.
Rasmus <rasmus@gmx.us> writes:
> I see. I disagree that it's more since it's directly inside a loop over
> org-footnote-re. So if we are not at a footnote-{reference,definition}
> it's probably a bug in the regexp.
Pleonasm.
Note that the regexp can match even if not at a footnote reference:
#+begin_example
int x = k[1]
#+end_example
>> [fn: ref with space]
>
> While your comment excels in preciseness the terseness makes it hard to
> appreciate its depth. In my org-installation "[fn: ref with space]" is
> not a valid footnote.
Actually, I wanted to say it wasn't valid, then changed my mind, and
eventually forgot to remove it from my mail.
In a thousand years, scholars might debate over the secret meaning
behind these symbols.
>> This marker is not necessary since you're not going to add contents
>> before (point-min) anyway. A plain number is enough.
>
> I might if I include *Bar here:
>
> * Foo
> [1] foo
>
> * Bar
> Baz[1]
I'm not sure to understand. Would you mind elaborating?
> + (unless included
> + (org-with-wide-buffer
> + (goto-char (point-max))
> + (unless (bolp) (insert "\n"))
> + (maphash (lambda (ref def) (insert (format "[%s] %s\n" ref def)))
> + footnotes)))))))))))
The more I look at it, the more I'm seduced by
(unless included
(org-with-wide-buffer
(goto-char (point-max))
(maphash (lambda (ref def) (insert (format "\n[%s] %s\n" ref def)))
footnotes)))))))))))
I'm really nitpicking, tho.
> ;; Append ID to all footnote references and definitions, so they
> ;; become file specific and cannot collide with footnotes in other
> ;; included files.
> + ;; Further, collect relevant footnotes outside of LINES.
You can include it in the previous paragraph, or insert a blank comment
line, as it wouldn't survive a M-q.
> + (goto-char (1+ (org-element-property :begin reference)))
> + (when label
Shouldn't these two lines be inverted?
> + (let* ((definition (org-footnote-get-definition label))
> + (beginning (copy-marker (nth 1 definition))))
Actually, BEGINNING doesn't need to be a marker either: you always
modify buffer after it.
Regards,
next prev parent reply other threads:[~2014-12-22 20:53 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 [this message]
2014-12-22 22:11 ` Rasmus
2014-12-22 22:51 ` Nicolas Goaziou
2014-12-23 2:09 ` Rasmus
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=87h9wn4d8r.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=rasmus@gmx.us \
/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).