Browse Source

org-footnote: Fix location after moving to definition

* lisp/org-footnote.el (org-footnote-goto-definition): Move to location
  appropriate for further editing.
* testing/lisp/test-org-footnote.el (test-org-footnote/delete): Update
  test.
Nicolas Goaziou 9 years ago
parent
commit
8500501984
2 changed files with 2 additions and 2 deletions
  1. 1 1
      lisp/org-footnote.el
  2. 1 1
      testing/lisp/test-org-footnote.el

+ 1 - 1
lisp/org-footnote.el

@@ -387,7 +387,7 @@ value if point was successfully moved."
       (user-error "Definition is outside narrowed part of buffer")))
     (org-mark-ring-push)
     (goto-char def-start)
-    (looking-at (format "\\[%s[]:]" label))
+    (looking-at (format "\\[%s[]:] ?" label))
     (goto-char (match-end 0))
     (org-show-context 'link-search)
     (when (derived-mode-p 'org-mode)

+ 1 - 1
testing/lisp/test-org-footnote.el

@@ -172,7 +172,7 @@
   ;; anonymous footnotes.
   (should
    (equal
-    " Definition."
+    "Definition."
     (org-test-with-temp-text "Some text\n[fn:1] Definition."
       (org-footnote-goto-definition "fn:1")
       (buffer-substring (point) (point-max)))))