瀏覽代碼

org-footnote: don't move point for unsuccessful search of the next footnote

* lisp/org-footnote.el (org-footnote-next-reference-or-definition): if
  no more footnote is found, be sure to go back to the original
  position. Otherwise, point might be left on a footnote-like element
  that has been dished out.
Nicolas Goaziou 13 年之前
父節點
當前提交
520bd1feac
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lisp/org-footnote.el

+ 2 - 1
lisp/org-footnote.el

@@ -295,10 +295,11 @@ LIMIT is the buffer position bounding the search.
 Return value is a list like those provided by
 `org-footnote-at-reference-p' or `org-footnote-at-definition-p'.
 If no footnote is found, return nil."
-  (let* (ref)
+  (let* (ref (origin (point)))
     (catch 'exit
       (while t
 	(unless (re-search-forward org-footnote-re limit t)
+	  (goto-char origin)
 	  (throw 'exit nil))
 	;; Beware: with [1]-like footnotes point will be just after
 	;; the closing square bracket.