summaryrefslogtreecommitdiff
path: root/lisp/org/org-footnote.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org-footnote.el')
-rw-r--r--lisp/org/org-footnote.el29
1 files changed, 17 insertions, 12 deletions
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el
index 5964ef4ce2c..2a2c4c0f426 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.35i
+;; Version: 7.01
;;
;; This file is part of GNU Emacs.
;;
@@ -65,6 +65,11 @@
(org-re "^\\(\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]\\)")
"Regular expression matching the definition of a footnote.")
+(defgroup org-footnote nil
+ "Footnotes in Org-mode."
+ :tag "Org Footnote"
+ :group 'org)
+
(defcustom org-footnote-section "Footnotes"
"Outline heading containing footnote definitions before export.
This can be nil, to place footnotes locally at the end of the current
@@ -75,7 +80,7 @@ automatically, i.e. when creating the footnote, and when sorting the notes.
However, by hand you may place definitions *anywhere*.
If this is a string, during export, all subtrees starting with this
heading will be removed after extracting footnote definitions."
- :group 'org-footnotes
+ :group 'org-footnote
:type '(choice
(string :tag "Collect footnotes under heading")
(const :tag "Define footnotes locally" nil)))
@@ -87,7 +92,7 @@ as in Org-mode. Outside Org-mode, new footnotes are always placed at
the end of the file. When you normalize the notes, any line containing
only this tag will be removed, a new one will be inserted at the end
of the file, followed by the collected and normalized footnotes."
- :group 'org-footnotes
+ :group 'org-footnote
:type 'string)
(defcustom org-footnote-define-inline nil
@@ -182,25 +187,25 @@ with start and label of the footnote if there is a definition at point."
(org-show-context 'link-search)
(message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))))
-(defun org-footnote-goto-next-reference (label)
- "Find the next reference of the footnote with label LABEL."
+(defun org-footnote-goto-previous-reference (label)
+ "Find the next previous of the footnote with label LABEL."
(interactive "sLabel: ")
(org-mark-ring-push)
(setq label (org-footnote-normalize-label label))
(let ((re (format ".\\[%s[]:]" label))
(p0 (point)) pos)
(save-excursion
- (setq pos (or (re-search-forward re nil t)
- (and (goto-char (point-min))
- (re-search-forward re nil t))
+ (setq pos (or (re-search-backward re nil t)
+ (and (goto-char (point-max))
+ (re-search-backward re nil t))
(and (progn (widen) t)
(goto-char p0)
- (re-search-forward re nil t))
- (and (goto-char (point-min))
+ (re-search-backward re nil t))
+ (and (goto-char (point-max))
(re-search-forward re nil t)))))
(if pos
(progn
- (goto-char pos)
+ (goto-char (match-end 0))
(org-show-context 'link-search))
(error "Cannot find reference of footnote %s" label))))
@@ -339,7 +344,7 @@ With prefix arg SPECIAL, offer additional commands in a menu."
(org-footnote-goto-definition (nth 1 tmp))
(goto-char (match-beginning 4))))
((setq tmp (org-footnote-at-definition-p))
- (org-footnote-goto-next-reference (nth 1 tmp)))
+ (org-footnote-goto-previous-reference (nth 1 tmp)))
(t (org-footnote-new)))))
;;;###autoload