Browse Source

org-footnote: fix commit 774f9cb8e63f9739207581b81710c8b6b8cf4d01

* lisp/org-footnote.el (org-footnote-create-definition): Explicitely
  move point after tag, if it has just been inserted.
Nicolas Goaziou 13 years ago
parent
commit
c7abf641eb
1 changed files with 6 additions and 6 deletions
  1. 6 6
      lisp/org-footnote.el

+ 6 - 6
lisp/org-footnote.el

@@ -527,13 +527,13 @@ or new, let the user edit the definition of the footnote."
 	;; Check if the footnote tag is defined but missing.  In this
 	;; case, insert it, before any footnote or one blank line
 	;; after any previous text.
-	(save-excursion
-	  (when (and tag (not (re-search-backward tag nil t)))
-	    (skip-chars-backward " \t\r\n")
-	    (while (re-search-backward org-footnote-definition-re nil t))
-	    (unless (bolp) (newline 2))
-	    (insert org-footnote-tag-for-non-org-mode-files "\n\n")))
+	(when (and tag (not (re-search-backward tag nil t)))
+	  (skip-chars-backward " \t\r\n")
+	  (while (re-search-backward org-footnote-definition-re nil t))
+	  (unless (bolp) (newline 2))
+	  (insert org-footnote-tag-for-non-org-mode-files "\n\n"))
 	;; Remove superfluous white space and clear marker.
+	(goto-char max)
 	(skip-chars-backward " \t\r\n")
 	(delete-region (point) max)
 	(unless (bolp) (newline))