summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-09-29 15:30:46 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2011-09-29 15:30:46 +0200
commitc00fe037be229c643dd0ab10643d178ff2f9da1b (patch)
treecd063f8620754e5cf9439d1a491423d9d6b91931
parentc7abf641ebb30bfa5761b9b175fe6976402ab9d2 (diff)
downloadorg-mode-c00fe037be229c643dd0ab10643d178ff2f9da1b.tar.gz
org-footnote: Don't offer to create a footnote when it already exists
* lisp/org-footnote.el (org-footnote-goto-definition): This patch makes sure the function says when a definition has been found. Thus, moving from the reference to the definition doesn't offer to create the latter again.
-rw-r--r--lisp/org-footnote.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 1cad895..46a2c43 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -343,7 +343,8 @@ If no footnote is found, return nil."
((org-footnote-at-definition-p)))))))))
(defun org-footnote-goto-definition (label)
- "Move point to the definition of the footnote LABEL."
+ "Move point to the definition of the footnote LABEL.
+Return a non-nil value when a definition has been found."
(interactive "sLabel: ")
(org-mark-ring-push)
(let ((def (org-footnote-get-definition label)))
@@ -354,7 +355,8 @@ If no footnote is found, return nil."
(goto-char (match-end 0))
(org-show-context 'link-search)
(when (org-mode-p)
- (message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'.")))))
+ (message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))
+ t)))
(defun org-footnote-goto-previous-reference (label)
"Find the first closest (to point) reference of footnote with label LABEL."