From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Guerry Subject: [Accepted] Goto correct footnote insertion point in org-mode buffers Date: Thu, 17 Mar 2011 09:24:09 +0100 (CET) Message-ID: <20110317082409.3E55F6523@myhost.localdomain> References: <871v2bjh4z.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=51960 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0A9X-0000yn-Cz for emacs-orgmode@gnu.org; Thu, 17 Mar 2011 06:10:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0A9W-0003PE-AZ for emacs-orgmode@gnu.org; Thu, 17 Mar 2011 06:09:59 -0400 Received: from mail-wy0-f195.google.com ([74.125.82.195]:54298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0A9W-0003Oz-3w for emacs-orgmode@gnu.org; Thu, 17 Mar 2011 06:09:58 -0400 Received: by wyb32 with SMTP id 32so471656wyb.6 for ; Thu, 17 Mar 2011 03:09:57 -0700 (PDT) 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: emacs-orgmode@gnu.org Patch 678 (http://patchwork.newartisans.com/patch/678/) is now "Accepted". Maintainer comment: none This relates to the following submission: http://mid.gmane.org/%3C871v2bjh4z.fsf%40fastmail.fm%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O] Goto correct footnote insertion point in org-mode buffers > Date: Fri, 11 Mar 2011 18:47:08 -0000 > From: Matt Lundin > X-Patchwork-Id: 678 > Message-Id: <871v2bjh4z.fsf@fastmail.fm> > 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'."))) >