From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Don't call org-footnote-unique label if using random labels Date: Sat, 5 May 2012 11:58:22 -0500 Message-ID: <877gwq8sx8.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQiL6-0005M5-JZ for emacs-orgmode@gnu.org; Sat, 05 May 2012 13:00:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQiL4-0001vj-QV for emacs-orgmode@gnu.org; Sat, 05 May 2012 13:00:12 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:48033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQiL4-0001vM-Ca for emacs-orgmode@gnu.org; Sat, 05 May 2012 13:00:10 -0400 Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 9112A20D96 for ; Sat, 5 May 2012 13:00:07 -0400 (EDT) Received: from archeee (c-98-213-43-118.hsd1.il.comcast.net [98.213.43.118]) by mail.messagingengine.com (Postfix) with ESMTPSA id F29B248353A for ; Sat, 5 May 2012 13:00:06 -0400 (EDT) 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: Org Mode * 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