summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-14 00:54:07 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-14 01:05:40 +0200
commitf8c4102cc6e65d48e0b9502cc568843a86f92f1c (patch)
tree91c51c7bf8a008e2c710e5b485cf638a5e0a95b6
parent719a201c3bb2e8bc35b53a372090a9e04d26f275 (diff)
downloadorg-mode-f8c4102cc6e65d48e0b9502cc568843a86f92f1c.tar.gz
org-footnote: Fix positioning when inserting footnotes
* lisp/org-footnote.el (org-footnote-new): Fix point when a new footnote triggers sorting. Reported-by: Gerald Wildgruber <Gerald.Wildgruber@unibas.ch> <http://permalink.gmane.org/gmane.emacs.orgmode/99997>
-rw-r--r--lisp/org-footnote.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 7396609..e23e417 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -552,13 +552,13 @@ or new, let the user edit the definition of the footnote."
(org-footnote-auto-adjust-maybe))
(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-footnote-create-definition label)
+ (org-footnote-auto-adjust-maybe)
+ (if (ignore-errors (org-footnote-goto-definition label))
+ (forward-char)
+ ;; Definition was created outside current scope: edit it
+ ;; remotely.
+ (org-edit-footnote-reference))))))
(defvar org-blank-before-new-entry) ; Silence byte-compiler.
(defun org-footnote-create-definition (label)