emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Don't call org-footnote-unique label if using random labels
Date: Sat, 5 May 2012 11:58:22 -0500	[thread overview]
Message-ID: <877gwq8sx8.fsf@fastmail.fm> (raw)

* lisp/org-footnote.el (org-footnote-new): Don't call
  org-footnote-unique-label if org-footnote-auto-label is set to
  random.

Calling org-footnote-unique-label calls org-footnote-all-labels, which
can dramatically slow down footnote creation in a buffer with many
footnotes.  This is unecessary if org-footnote-auto-label is set to
random.
---
 lisp/org-footnote.el |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index b0472f3..504f633 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -450,7 +450,8 @@ or new, let the user edit the definition of the footnote."
     (error "Cannot insert a footnote here"))
   (let* ((lbls (and (not (equal org-footnote-auto-label 'random))
 		    (org-footnote-all-labels)))
-	 (propose (org-footnote-unique-label lbls))
+	 (propose (and (not (equal org-footnote-auto-label 'random))
+		       (org-footnote-unique-label lbls)))
 	 (label
 	  (org-footnote-normalize-label
 	   (cond
-- 
1.7.10.1

             reply	other threads:[~2012-05-05 17:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-05 16:58 Matt Lundin [this message]
2012-05-06  8:10 ` [PATCH] Don't call org-footnote-unique label if using random labels Bastien

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=877gwq8sx8.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --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).