forked from mirrors/org-mode
Change `org-open-at-point' behaviour in footnote definitions
* lisp/org.el (org-open-at-point): In a footnote definition, return to footnote reference only when point is on the footnote label.
This commit is contained in:
parent
8b2d3645ac
commit
5dd8058c0c
17
lisp/org.el
17
lisp/org.el
|
@ -10598,13 +10598,18 @@ is used internally by `org-open-link-from-string'."
|
||||||
(eval cmd))
|
(eval cmd))
|
||||||
(error (progn (widen) (eval cmd)))))))
|
(error (progn (widen) (eval cmd)))))))
|
||||||
(t (browse-url-at-point))))))
|
(t (browse-url-at-point))))))
|
||||||
;; On a footnote reference or in a footnote definition.
|
;; On a footnote reference or at a footnote definition's label.
|
||||||
((or (eq type 'footnote-reference)
|
((or (eq type 'footnote-reference)
|
||||||
(let ((parent context))
|
(and (eq type 'footnote-definition)
|
||||||
(while (and (setq parent (org-element-property :parent parent))
|
(save-excursion
|
||||||
(not (eq (org-element-type parent)
|
;; Do not validate action when point is on the
|
||||||
'footnote-definition))))
|
;; spaces right after the footnote label, in order
|
||||||
parent))
|
;; to be on par with behaviour on links.
|
||||||
|
(skip-chars-forward " \t")
|
||||||
|
(let ((begin (org-element-property :contents-begin context)))
|
||||||
|
(if begin (< (point) begin)
|
||||||
|
(= (line-beginning-position)
|
||||||
|
(org-element-property :post-affiliated context)))))))
|
||||||
(org-footnote-action))
|
(org-footnote-action))
|
||||||
(t (user-error "No link found"))))
|
(t (user-error "No link found"))))
|
||||||
(move-marker org-open-link-marker nil)
|
(move-marker org-open-link-marker nil)
|
||||||
|
|
Loading…
Reference in a new issue