From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Re: Annoying positioning of point when writing footnotes Date: Thu, 13 Aug 2015 13:16:22 -0500 Message-ID: <87egj7rr49.fsf_-_@fastmail.fm> References: <87wpwzp7oj.fsf@unibas.ch> <87h9o3jhk6.fsf@fastmail.fm> <87vbcjp2b0.fsf@unibas.ch> <87io8jrrx6.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPx3K-0007f3-91 for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 14:16:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPx3A-0002r4-Fp for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 14:16:34 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:36289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPx3A-0002qu-6k for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 14:16:24 -0400 In-Reply-To: <87io8jrrx6.fsf@fastmail.fm> (Matt Lundin's message of "Thu, 13 Aug 2015 12:59:01 -0500") 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: Gerald Wildgruber Cc: orgmode list --=-=-= Content-Type: text/plain Matt Lundin writes: > Gerald Wildgruber writes: > >> Matt, thanks! looking forward to any elucidation you can give on the >> problem at hand! > > Could you tell me what the value of org-footnote-auto-adjust is on your > machine? > > It seems on my end that the problem only occurs when > org-footnote-auto-adjust is set to t. The problem seems to be line 556 > of org-footnote.el, which reorders the footnotes *after* the position of > the footnote definition has been saved. When I remove that line or set > org-footnote-auto-adjust to nil, the cursor is positioned correctly. This patch should fix the issue. Testing is welcome. Matt --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-position-of-cursor-when-creating-footnotes.patch >From d52d6b331e92dddce5477c131858ded7e091599e Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Thu, 13 Aug 2015 13:14:34 -0500 Subject: [PATCH] Fix position of cursor when creating footnotes * lisp/org-footnote.el (org-footnote-auto-label): Call org-footnote-auto-adjust-maybe after going to the footnote definition. Otherwise the correct position is lost. --- lisp/org-footnote.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 7396609..1048219 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -553,12 +553,12 @@ or new, let the user edit the definition of the footnote." (t (insert "[" label "]") (let ((l (copy-marker (org-footnote-create-definition label)))) - (org-footnote-auto-adjust-maybe) (or (ignore-errors (org-footnote-goto-definition label l)) ;; Since definition was created outside current ;; scope, edit it remotely. (progn (set-marker l nil) - (org-edit-footnote-reference)))))))) + (org-edit-footnote-reference)))) + (org-footnote-auto-adjust-maybe))))) (defvar org-blank-before-new-entry) ; Silence byte-compiler. (defun org-footnote-create-definition (label) -- 2.5.0 --=-=-=--