Browse Source

Footnotes: Fix some minor issues.

Carsten Dominik 16 năm trước cách đây
mục cha
commit
20dbb0c73f
3 tập tin đã thay đổi với 11 bổ sung4 xóa
  1. 6 0
      lisp/ChangeLog
  2. 2 1
      lisp/org-footnote.el
  3. 3 3
      lisp/org.el

+ 6 - 0
lisp/ChangeLog

@@ -1,5 +1,11 @@
 2009-01-24  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-activate-footnote-links): Improve footnote link
+	highlighting.
+
+	* org-footnote.el (org-footnote-normalize): Fix finding the end of
+	a footnote definition at the end of the file.
+
 	* org-table.el (org-table-get-specials): Add an imagined hline at
 	the end of the table.  This can be useful for references that want
 	to go to the end of the table.  Also fix bug when computing last

+ 2 - 1
lisp/org-footnote.el

@@ -352,7 +352,8 @@ referenced sequence."
 		 (re-search-forward
 		  (org-re "^[ \t]*$\\|^\\*+ \\|^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]")
 		  nil 'move)
-		 (setq def (buffer-substring beg1 (match-beginning 0)))
+		 (setq def (buffer-substring beg1 (or (match-beginning 0)
+						      (point-max))))
 		 (goto-char beg)
 		 (skip-chars-backward " \t\n\t")
 		 (delete-region (1+ (point)) (match-beginning 0))))))

+ 3 - 3
lisp/org.el

@@ -3788,12 +3788,12 @@ will be prompted for."
   (if (re-search-forward "\\(^\\|[^][]\\)\\(\\[\\([0-9]+\\]\\|fn:[^ \t\r\n:]+?[]:]\\)\\)" 
 			 limit t)
       (progn
-	(add-text-properties (match-beginning 1) (match-end 1)
+	(add-text-properties (match-beginning 2) (match-end 2)
 			     (list 'mouse-face 'highlight
 				   'rear-nonsticky org-nonsticky-props
 				   'keymap org-mouse-map
 				   'help-echo
-				   (if (= (point-at-bol) (match-beginning 1))
+				   (if (= (point-at-bol) (match-beginning 2))
 				       "Footnote definition"
 				     "Footnote reference")
 				   ))
@@ -4054,7 +4054,7 @@ between words."
 	   (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t)))
 	   (if (memq 'date lk) '(org-activate-dates (0 'org-date t)))
 	   (if (memq 'footnote lk) '(org-activate-footnote-links
-				     (0 'org-footnote t)))
+				     (2 'org-footnote t)))
 	   '("^&?%%(.*\\|<%%([^>\n]*?>" (0 'org-sexp-date t))
 	   '(org-hide-wide-columns (0 nil append))
 	   ;; TODO lines