forked from mirrors/org-mode
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.
This commit is contained in:
parent
9ff7f80f51
commit
520bd1feac
|
@ -295,10 +295,11 @@ LIMIT is the buffer position bounding the search.
|
||||||
Return value is a list like those provided by
|
Return value is a list like those provided by
|
||||||
`org-footnote-at-reference-p' or `org-footnote-at-definition-p'.
|
`org-footnote-at-reference-p' or `org-footnote-at-definition-p'.
|
||||||
If no footnote is found, return nil."
|
If no footnote is found, return nil."
|
||||||
(let* (ref)
|
(let* (ref (origin (point)))
|
||||||
(catch 'exit
|
(catch 'exit
|
||||||
(while t
|
(while t
|
||||||
(unless (re-search-forward org-footnote-re limit t)
|
(unless (re-search-forward org-footnote-re limit t)
|
||||||
|
(goto-char origin)
|
||||||
(throw 'exit nil))
|
(throw 'exit nil))
|
||||||
;; Beware: with [1]-like footnotes point will be just after
|
;; Beware: with [1]-like footnotes point will be just after
|
||||||
;; the closing square bracket.
|
;; the closing square bracket.
|
||||||
|
|
Loading…
Reference in New Issue