;;; footnote.el --- footnote support for message mode -*- coding: iso-latin-1;-*-
;; Copyright (C) 1997, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Steven L Baur <steve@xemacs.org>
;; Keywords: mail, news
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
-;; GNU Emacs is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-;; MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Default styles
;;; NUMERIC
-(defconst footnote-numeric-regexp "[0-9]"
+(defconst footnote-numeric-regexp "[0-9]+"
"Regexp for digits.")
(defun Footnote-numeric (n)
(defconst footnote-english-upper "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"Upper case English alphabet.")
-(defconst footnote-english-upper-regexp "[A-Z]"
+(defconst footnote-english-upper-regexp "[A-Z]+"
"Regexp for upper case English alphabet.")
(defun Footnote-english-upper (n)
(defconst footnote-english-lower "abcdefghijklmnopqrstuvwxyz"
"Lower case English alphabet.")
-(defconst footnote-english-lower-regexp "[a-z]"
+(defconst footnote-english-lower-regexp "[a-z]+"
"Regexp of lower case English alphabet.")
(defun Footnote-english-lower (n)
(50 . "l") (100 . "c") (500 . "d") (1000 . "m"))
"List of roman numerals with their values.")
-(defconst footnote-roman-lower-regexp "[ivxlcdm]"
+(defconst footnote-roman-lower-regexp "[ivxlcdm]+"
"Regexp of roman numerals.")
(defun Footnote-roman-lower (n)
(50 . "L") (100 . "C") (500 . "D") (1000 . "M"))
"List of roman numerals with their values.")
-(defconst footnote-roman-upper-regexp "[IVXLCDM]"
+(defconst footnote-roman-upper-regexp "[IVXLCDM]+"
"Regexp of roman numerals. Not complete")
(defun Footnote-roman-upper (n)
(defconst footnote-latin-string "¹²³ºª§¶"
"String of Latin-1 footnoting characters.")
+;; Note not [...]+, because this style cycles.
(defconst footnote-latin-regexp (concat "[" footnote-latin-string "]")
"Regexp for Latin-1 footnoting characters.")
(defun Footnote-current-regexp ()
"Return the regexp of the index of the current style."
(concat (nth 2 (or (assq footnote-style footnote-style-alist)
- (nth 0 footnote-style-alist))) "*"))
+ (nth 0 footnote-style-alist)))
+ "*"))
(defun Footnote-refresh-footnotes (&optional index-regexp)
"Redraw all footnotes.
(search-backward footnote-start-tag nil t)
(when (looking-at (concat
(regexp-quote footnote-start-tag)
- "\\(" index-regexp "\\)"
+ "\\(" index-regexp "+\\)"
(regexp-quote footnote-end-tag)))
(replace-match (concat
footnote-start-tag
(goto-char (cdr alist))
(when (looking-at (concat
(regexp-quote footnote-start-tag)
- "\\(" index-regexp "\\)"
+ "\\(" index-regexp "+\\)"
(regexp-quote footnote-end-tag)))
(replace-match (concat
footnote-start-tag
(provide 'footnote)
-;;; arch-tag: 9bcfb6d7-2161-4caf-8793-700f62400398
+;; arch-tag: 9bcfb6d7-2161-4caf-8793-700f62400398
;;; footnote.el ends here