From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Goto correct footnote insertion point in org-mode buffers Date: Fri, 11 Mar 2011 08:47:08 -0500 Message-ID: <871v2bjh4z.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=58455 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pyl95-0007nT-U5 for emacs-orgmode@gnu.org; Sun, 13 Mar 2011 09:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pyl94-0005NO-Hz for emacs-orgmode@gnu.org; Sun, 13 Mar 2011 09:15:43 -0400 Received: from out5.smtp.messagingengine.com ([66.111.4.29]:50342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pyl94-0005NJ-Aw for emacs-orgmode@gnu.org; Sun, 13 Mar 2011 09:15:42 -0400 Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id F241F2084E for ; Sun, 13 Mar 2011 09:15:41 -0400 (EDT) Received: from archdesk (67-197-63-212.rh2.dyn.cm.comporium.net [67.197.63.212]) by mail.messagingengine.com (Postfix) with ESMTPSA id B62A9440BB1 for ; Sun, 13 Mar 2011 09:15:41 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode * lisp/org-footnote.el: (org-footnote-create-definition): Don't search for last footnote when in org-mode file. The recent changes to accommodate signatures in message-mode instruct org-mode to search for the last footnote in the entire buffer when inserting a new footnote definition. This causes problems in org buffers, since org-footnote-goto-local-insertion-point already finds the correct insertion point. (I.e., the insertion point is always placed in beneath the last footnote in the buffer, even if org-footnote-section is nil.) This patch invokes the search only if in non org-mode buffers. --- lisp/org-footnote.el | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index f2b3489..0524b41 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -310,10 +310,10 @@ or new, let the user edit the definition of the footnote." (skip-chars-backward " \t\r\n") (delete-region (point) max) (insert "\n\n") - (insert org-footnote-tag-for-non-org-mode-files "\n"))))) - ;; Skip existing footnotes - (while (re-search-forward "^[[:space:]]*\\[[^]]+\\] " nil t) - (forward-line)) + (insert org-footnote-tag-for-non-org-mode-files "\n"))) + ;; Skip existing footnotes + (while (re-search-forward "^[[:space:]]*\\[[^]]+\\] " nil t) + (forward-line)))) (insert "\n[" label "] \n") (goto-char (1- (point))) (message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))) -- 1.7.4.1