org-footnote: preserve narrowing when searching a definition
* lisp/org-footnote.el (org-footnote-get-definition): the function has to widen buffer if definition has not been found in the current narrowed part. Be sure to restore that restriction once the definition is found.
This commit is contained in:
parent
cd8d1b095b
commit
4574cc11bc
|
@ -328,6 +328,7 @@ If no footnote is found, return nil."
|
||||||
(re (format "^\\[%s\\]\\|.\\[%s:" label label))
|
(re (format "^\\[%s\\]\\|.\\[%s:" label label))
|
||||||
pos)
|
pos)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(save-restriction
|
||||||
(when (or (re-search-forward re nil t)
|
(when (or (re-search-forward re nil t)
|
||||||
(and (goto-char (point-min))
|
(and (goto-char (point-min))
|
||||||
(re-search-forward re nil t))
|
(re-search-forward re nil t))
|
||||||
|
@ -337,7 +338,7 @@ If no footnote is found, return nil."
|
||||||
(let ((refp (org-footnote-at-reference-p)))
|
(let ((refp (org-footnote-at-reference-p)))
|
||||||
(cond
|
(cond
|
||||||
((and (nth 3 refp) refp))
|
((and (nth 3 refp) refp))
|
||||||
((org-footnote-at-definition-p))))))))
|
((org-footnote-at-definition-p)))))))))
|
||||||
|
|
||||||
(defun org-footnote-goto-definition (label)
|
(defun org-footnote-goto-definition (label)
|
||||||
"Move point to the definition of the footnote LABEL."
|
"Move point to the definition of the footnote LABEL."
|
||||||
|
|
Loading…
Reference in New Issue