diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2bfadb788..5597a8a9d 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2009-01-19 Carsten Dominik + * org.el (org-activate-footnote-links): Don't allow match inside a + link. + + * org-footnote.el (org-footnote-re): Don't allow match inside a link. + * org-export-latex.el (org-export-latex-links): Keep a relative path relative also after export. diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index d4b8bc1b7..2c21f63c2 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -47,7 +47,7 @@ (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) (defconst org-footnote-re - (concat "." ; to make sure it is not at the beginning of a line + (concat "[^][\n]" ; to make sure it is not at the beginning of a line "\\[" "\\(?:" "\\([0-9]+\\)" diff --git a/lisp/org.el b/lisp/org.el index a97751e2f..dca6273ab 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3785,15 +3785,15 @@ will be prompted for." (defun org-activate-footnote-links (limit) "Run through the buffer and add overlays to links." - (if (re-search-forward "\\[\\([0-9]+\\]\\|fn:[^ \t\r\n:]+?[]:]\\)" + (if (re-search-forward "\\(^\\|[^][]\\)\\(\\[\\([0-9]+\\]\\|fn:[^ \t\r\n:]+?[]:]\\)\\)" limit t) (progn - (add-text-properties (match-beginning 0) (match-end 0) + (add-text-properties (match-beginning 1) (match-end 1) (list 'mouse-face 'highlight 'rear-nonsticky org-nonsticky-props 'keymap org-mouse-map 'help-echo - (if (= (point-at-bol) (match-beginning 0)) + (if (= (point-at-bol) (match-beginning 1)) "Footnote definition" "Footnote reference") ))