Commits

Anonymous committed b8b2879

Created.

  • Participants
  • Tags xemacs

Comments (0)

Files changed (9)

+1998-01-12  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile: Update to newer package interface.
+
+1998-01-09  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile: replaced.
+	Integrated as XEmacs package.
+
+1997-12-17  SL Baur  <steve@altair.xemacs.org>
+
+	* footnote.el (Footnote-add-footnote): Autoload.
+
+1997-10-11  SL Baur  <steve@altair.xemacs.org>
+
+	* footnote.el (footnote-prefix): Change prefix to `C-c !'.
+	Add keymap to minor mode maps.
+
+1997-10-08  SL Baur  <steve@altair.xemacs.org>
+
+	* footnote.el (footnote-mode-map): Autoload the keymap.
+	Suggested by: Per Abrahamsen <abraham@dina.kvl.dk>
+	(Footnote-setup-keybindings): Do not bind the footnote keymap
+	unconditionally.
+
+1997-10-07  SL Baur  <steve@altair.xemacs.org>
+
+	* footnote.el (footnote-mode): Correct spelling of function
+	names.
+	(Footnote-roman-common): New function.  Unification
+	`Footnote-roman-upper' and `Footnote-roman-lower'.
+	(Footnote-english-lower): Rename.
+	(Footnote-roman-lower): Rename, use `Footnote-roman-common' for
+	core code.
+	(Footnote-roman-upper): Ditto.
+	(footnote-style-alist): Fix case of functions.
+
+	* Integrated patches from James Lewis Moss adding Roman Numerals
+	and more flexibility in the layout of footnotes.
+
+1997-10-07  SL Baur  <steve@altair.xemacs.org>
+
+	* footnote.el (footnote-section-tag-regexp): New variable.
+	(Footnote-narrow-to-footnotes): Use it.
+	(Footnote-insert-footnote): Ditto.
+	(Footnote-delete-footnote): Ditto.
+	(Footnote-goto-footnote): Ditto.
+
+1997-10-06  SL Baur  <steve@altair.xemacs.org>
+
+	* footnote.el (footnote-signature-separator): New variable.
+	(Footnote-narrow-to-footnotes): Use it.
+	(Footnote-goto-char-point-max): Ditto.
+	(footnote-section-tag): Allow for optional tag.
+
+	* footnote-kana.el: New file.
+	From: Stephen J Turnbull <turnbull@sk.tsukuba.ac.jp>
+
+1997-10-01  SL Baur  <steve@altair.xemacs.org>
+
+	* footnote.el (Footnote-delete-footnote): Fix problems with
+	deleting last footnote.
+	(Footnote-goto-char-point-max): Don't return nil if no .signature
+	is present.
+
+1997-09-30  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile (MULE_ELCS): Rename footnote-japanese.el to
+	footnote-han.el.
+
+	* footnote-hebrew.el (Footnote-hebrew): Rename.
+
+	* footnote-greek.el (Footnote-greek-lower): Rename.
+	(Footnote-greek-upper): Ditto.
+
+	* footnote-han.el (Footnote-han): Rename.
+
+	* footnote-cyrillic.el (Footnote-cyrillic-upper): Rename.
+	(Footnote-cyrillic-lower): Ditto.
+
+	* footnote.el (Footnote-numeric): Rename.
+	(Footnote-english-upper): Ditto.
+	(Footnote-english-lower): Ditto.
+	(Footnote-style-p): Ditto.
+	(Footnote-index-to-string): Ditto.
+	(Footnote-current-regexp): Ditto.
+	(Footnote-refresh-footnotes): Ditto.
+	(Footnote-assoc-index): Ditto.
+	(Footnote-cycle-style): Ditto.
+	(Footnote-set-style): Ditto.
+	(Footnote-insert-numbered-footnote): Ditto.
+	(Footnote-renumber): Ditto.
+	(Footnote-narrow-to-footnotes): Ditto.
+	(Footnote-goto-char-point-max): Ditto.
+	(Footnote-insert-text-marker): Ditto.
+	(Footnote-insert-pointer-marker): Ditto.
+	(Footnote-insert-footnote): Ditto.
+	(Footnote-sort): Ditto.
+	(Footnote-text-under-cursor): Ditto.
+	(Footnote-under-cursor): Ditto.
+	(Footnote-make-hole): Ditto.
+	(Footnote-add-footnote): Ditto.
+	(Footnote-delete-footnote): Ditto.
+	(Footnote-renumber-footnotes): Ditto.
+	(Footnote-goto-footnote): Ditto.
+	(Footnote-back-to-message): Ditto.
+	(Footnote-setup-keybindings): Ditto.
+	(footnote-mode-line-string): Autoload.
+
+	* footnote-han.el: Rename from footnote-japanese.el
+	Suggested by: Stephen J. Turnbull <turnbull@turnbull.sk.tsukuba.ac.jp>
+
+1997-09-30  SL Baur  <steve@altair.xemacs.org>
+
+	* ChangeLog started at version 0.12.
+# Makefile for footnote lisp code
+
+# This file is part of XEmacs.
+
+# XEmacs 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.
+
+# XEmacs 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 XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# For the time being, remove MULE_ELCS from the all dependencies if
+# building without Mule.
+
+VERSION = 1.01
+PACKAGE = footnote
+PKG_TYPE = regular
+REQUIRES = mail-lib xemacs-base
+CATEGORY = comm
+
+ELCS = footnote.elc
+
+MULE_ELCS = footnote-cyrillic.elc footnote-greek.elc \
+	footnote-han.elc footnote-hebrew.elc footnote-kana.elc
+
+include ../../XEmacs.rules
+
+all:: $(ELCS) $(MULE_ELCS) auto-autoloads.elc custom-load.elc
+
+srckit: srckit-std
+
+binkit: binkit-sourceonly

File footnote-cyrillic.el

+;;; footnote-cyrillic.el --- Cyrillic lettering for footnote mode
+
+;; Copyright (C) 1997 by Free Software Foundation, Inc.
+
+;; Author: Steven L Baur <steve@altair.xemacs.org>
+;; Keywords: mule, news, mail
+;; Version: 0.17
+
+;; This file is part of XEmacs.
+
+;; XEmacs 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.
+
+;; XEmacs 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 XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
+;; This file provides support for Cyrillic lettering in footnote mode.
+;; It requires an Emacs or XEmacs with MULE internationalization.
+
+;;; Change Log:
+
+;; Apr-05-1997:	Replicate letters when footnote numbers hit the end of
+;;		the alphabet.
+;; Apr-18-1997:	Added regexp to the footnote style alist.
+
+;;; Code:
+
+(require 'footnote)
+
+(defconst footnote-cyrillic-lower "-L�������������������������������"-A
+  "Cyrillic lower case alphabet.")
+
+(defconst footnote-cyrillic-lower-regexp
+  (concat "[" footnote-cyrillic-lower "]")
+  "Regexp for lower case cyrillic.")
+
+(defconst footnote-cyrillic-upper "-L��ƴ�ijŸ�����������ö��˷�����"-A
+  "Cyrillic upper case alphabet.")
+
+(defconst footnote-cyrillic-upper-regexp
+  (concat "[" footnote-cyrillic-upper "]")
+  "Regexp for upper case cyrillic.")
+
+(defun Footnote-cyrillic-lower (n)
+  "Return a Cyrillic lower case letter.
+Wrapping around the alphabet implies successive repetitions of letters."
+  (let* ((ltr (mod (1- n) (length footnote-cyrillic-lower)))
+	 (rep (/ (1- n) (length footnote-cyrillic-lower)))
+	 (chr (char-to-string (aref footnote-cyrillic-lower ltr)))
+	 rc)
+    (while (>= rep 0)
+      (setq rc (concat rc chr))
+      (setq rep (1- rep)))
+    rc))
+
+(defun Footnote-cyrillic-upper (n)
+  "Return a Cyrillic upper case letter.
+Wrapping around the alphabet implies successive repetitions of letters."
+  (let* ((ltr (mod (1- n) (length footnote-cyrillic-upper)))
+	 (rep (/ (1- n) (length footnote-cyrillic-upper)))
+	 (chr (char-to-string (aref footnote-cyrillic-upper ltr)))
+	 rc)
+    (while (>= rep 0)
+      (setq rc (concat rc chr))
+      (setq rep (1- rep)))
+    rc))
+
+(setq footnote-style-alist
+      (append (list `(cyrillic-lower
+		      Footnote-cyrillic-lower
+		      ,footnote-cyrillic-lower-regexp)) footnote-style-alist))
+
+(setq footnote-style-alist
+      (append (list `(cyrillic-upper
+		      Footnote-cyrillic-upper
+		      ,footnote-cyrillic-upper-regexp)) footnote-style-alist))
+
+(provide 'footnote-cyrillic)
+
+;;; footnote-cyrillic.el ends here

File footnote-greek.el

+;;; footnote-greek.el --- Greek lettering for footnote mode
+
+;; Copyright (C) 1997 by Free Software Foundation, Inc.
+
+;; Author: Steven L Baur <steve@altair.xemacs.org>
+;; Keywords: mule, news, mail
+;; Version: 0.17
+
+;; This file is part of XEmacs.
+
+;; XEmacs 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.
+
+;; XEmacs 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 XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
+;; This file provides support for Greek lettering in footnote mode.
+;; It requires an Emacs or XEmacs with MULE internationalization.
+
+;;; Change Log:
+
+;; Apr-05-1997:	Replicate letters when footnote numbers hit the end of
+;;		the alphabet.
+;; Apr-18-1997:	Added regexp to the footnote style alist.
+
+;;; Code:
+
+(require 'footnote)
+
+(defconst footnote-greek-lower "-F������������������������"-A
+  "Greek lower case alphabet.")
+
+(defconst footnote-greek-lower-regexp
+  (concat "[" footnote-greek-lower "]")
+  "Regexp for lower case Greek.")
+
+(defconst footnote-greek-upper "-F������������������������"-A
+  "Greek upper case alphabet.")
+
+(defconst footnote-greek-upper-regexp
+  (concat "[" footnote-greek-upper "]")
+  "Regexp for upper case Greek.")
+
+(defun Footnote-greek-lower (n)
+  "Return a letter of Greek lower case.
+Wrapping around the alphabet implies successive repetitions of letters."
+  (let* ((ltr (mod (1- n) (length footnote-greek-lower)))
+	 (rep (/ (1- n) (length footnote-greek-lower)))
+	 (chr (char-to-string (aref footnote-greek-lower ltr)))
+	 rc)
+    (while (>= rep 0)
+      (setq rc (concat rc chr))
+      (setq rep (1- rep)))
+    rc))
+
+(defun Footnote-greek-upper (n)
+  "Return a letter of Greek upper case.
+Wrapping around the alphabet implies successive repetitions of letters."
+  (let* ((ltr (mod (1- n) (length footnote-greek-upper)))
+	 (rep (/ (1- n) (length footnote-greek-upper)))
+	 (chr (char-to-string (aref footnote-greek-upper ltr)))
+	 rc)
+    (while (>= rep 0)
+      (setq rc (concat rc chr))
+      (setq rep (1- rep)))
+    rc))
+
+(setq footnote-style-alist
+      (append (list `(greek-lower
+		      Footnote-greek-lower
+		      ,footnote-greek-lower-regexp)) footnote-style-alist))
+
+(setq footnote-style-alist
+      (append (list `(greek-upper
+		      Footnote-greek-upper
+		      ,footnote-greek-upper-regexp)) footnote-style-alist))
+
+(provide 'footnote-greek)
+
+;;; footnote-greek.el ends here

File footnote-han.el

+;;; footnote-han.el --- Han Japanese footnote support
+
+;; Copyright (C) 1997 by Free Software Foundation, Inc.
+
+;; Author: Steven L Baur <steve@altair.xemacs.org>
+;; Keywords: mail, news, mule
+;; Version: 0.17
+
+;; This file is part of XEmacs.
+
+;; XEmacs 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.
+
+;; XEmacs 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 XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
+;; $B?t(B $BJQ$($k(B
+
+;;; Change Log:
+
+;; Apr-18-1997:	Added regexp to the footnote style alist.
+;; Sep-30-1997: See ChangeLog file.
+
+;;; Code:
+
+(require 'footnote)
+
+(defconst footnote-han-digits "$B0lFs;0;M8^O;<7H,6e(B"
+  "$B7e(B")
+
+(defconst footnote-han-digits-regexp
+  (concat "[" footnote-han-digits "$B==(B" "]"))
+
+(defun Footnote-han (n)
+  "$B$+$($k(B $B$K(B $BF|K\8l(B."
+  (cond ((<= n 9)
+	 (char-to-string (aref footnote-han-digits (1- n))))
+	((= n 10)
+	 "$B==(B")
+	((<= n 19)
+	 (concat "$B==(B" (char-to-string (aref footnote-han-digits
+					    (1- (mod n 10))))))
+	(t
+	 (concat
+	  (char-to-string (aref footnote-han-digits (1- (/ n 10))))
+	  "$B==(B"
+	  (unless (= (mod n 10) 0)
+	    (char-to-string (aref footnote-han-digits
+				  (1- (mod n 10)))))))))
+
+(setq footnote-style-alist
+      (append (list `(han
+		      Footnote-han
+		      ,footnote-han-digits-regexp)) footnote-style-alist))
+
+(provide 'footnote-han)
+
+;;; footnote-han.el ends here

File footnote-hebrew.el

+;;; footnote-hebrew.el --- Hebrew lettering for footnote mode
+
+;; Copyright (C) 1997 by Free Software Foundation, Inc.
+
+;; Author: Steven L Baur <steve@altair.xemacs.org>
+;; Keywords: mule, news, mail
+;; Version: 0.17
+
+;; This file is part of XEmacs.
+
+;; XEmacs 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.
+
+;; XEmacs 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 XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
+;; This file provides support for Hebrew lettering in footnote mode.
+;; It requires an Emacs or XEmacs with MULE internationalization.
+
+;;; Change Log:
+
+;; Apr-05-1997:	Replicate letters when footnote numbers hit the end of
+;;		the alphabet.
+;; Apr-18-1997:	Added regexp to the footnote style alist.
+
+;;; Code:
+
+(require 'footnote)
+
+(defconst footnote-hebrew "�2]-H����������������������������0]"-A
+  "Hebrew alphabet.")
+
+(defconst footnote-hebrew-regexp
+  (concat "[" footnote-hebrew "]")
+  "Regexp for hebrew.")
+
+(defun Footnote-hebrew (n)
+  "Return a letter of Hebrew.
+Wrapping around the alphabet implies successive repetitions of letters."
+  (let* ((ltr (mod (1- n) (length footnote-hebrew)))
+	 (rep (/ (1- n) (length footnote-hebrew)))
+	 (chr (char-to-string (aref footnote-hebrew ltr)))
+	 rc)
+    (while (>= rep 0)
+      (setq rc (concat rc chr))
+      (setq rep (1- rep)))
+    rc))
+
+(setq footnote-style-alist
+      (append (list `(hebrew
+		      Footnote-hebrew
+		      ,footnote-hebrew-regexp)) footnote-style-alist))
+
+(provide 'footnote-hebrew)
+
+;;; footnote-hebrew.el ends here

File footnote-kana.el

+;;; footnote-kana.el --- more Japanese footnote support
+
+;; Copyright (C) 1997 by Stephen J Turnbull
+;; It is my intent to assign the copyright to the FSF but the papers 
+;; haven't been signed yet ;-)
+
+;; Author: Stephen J Turnbull <turnbull@sk.tsukuba.ac.jp>
+;; Keywords: mail, news, mule
+;; Version: 0.17
+
+;; This file is part of XEmacs.
+
+;; XEmacs 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.
+
+;; XEmacs 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 XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
+
+;; $BCm0U!'JQ$JF|K\8l$,$"$j$^$9!*=u$1$F$/$@$5$$!#(B
+
+;; $B;2>H?t$(J}$rBX$($k(B
+;; $B%$%m%O=g$^$?$O8^==2;=g$GJ?2>L>$^$?$OJR2>L>$N;X?t$rDs6!$$$?$7$^$9!#(B
+
+;; I diffidently suggest that the functions
+;; `footnote-kana-circular-index-string' (deprecated) and
+;; `footnote-kana-rep-index-string' and the variable
+;; `footnote-kana-index-function' be moved to footnote.el, the prefix be
+;; changed from `footenote-kana-' to `footnote-', and that
+;; footnote-greek.el and so on be modified to use the `rep' function.  The
+;; names are probably poorly chosen; I'm not at all wedded to them and
+;; didn't think too hard since they were originally only for use in
+;; footnote-kana.el.
+
+;;; Change Log:
+
+;;; Code:
+
+(require 'footnote)
+
+(defun Footnote-kana-circular-index-string (n index-string)
+  "Index footnotes using characters in order specified by INDEX-STRING.
+If the number of footnotes exceeds the length of the string, wrap around."
+  (char-to-string (aref index-string (1- (mod n (length index-string))))))
+
+;; Adapted (slightly) from footnote-greek.el.
+(defun Footnote-kana-rep-index-string (n index-string)
+  "Index footnotes using characters in order specified by INDEX-STRING.
+If the number of footnotes exceeds the length of the string, wrap around.
+Wrapping around the alphabet implies successive repetitions of characters."
+  (let* ((ltr (mod (1- n) (length index-string)))
+	 (rep (/ (1- n) (length index-string)))
+	 (chr (char-to-string (aref index-string ltr)))
+	 rc)
+    (while (>= rep 0)
+      (setq rc (concat rc chr))
+      (setq rep (1- rep)))
+    rc))
+
+(defvar footnote-kana-index-function
+  'footnote-kana-rep-index-string
+  "Function for indexing into an array of index characters.")
+
+(defconst footnote-katakana-iroha
+  "$B%$%m%O%K%[%X%H%A%j%L%k%r%o%+%h%?%l%=%D%M%J%i%`%&%p%N%*%/%d%^%1%U%3%(%F%"%5%-%f%a%_%7%q%R%b%;%9(B"
+  "$B%+%?%+%J!"%$%m%O=g(B")
+
+(defconst footnote-katakana-iroha-regexp
+  ;; can't use a range of JIS here; that would include "small" kana
+  ;; not the same as 50-sounds (I think); iroha includes "old" kana
+  ;; same comments apply to the remaining 3 regexps
+  (concat "[" footnote-katakana-iroha "]"))
+
+(defun Footnote-iroha-katakana (n)
+  "($BF|K\8l(B)$B%$%m%O=g$GJR2>L>$G;2>H$9$k$3$H!#(B
+
+Use Japanese katakana for indexing, in `iroha' order.  This is the
+`normal' case because katakana are commonly used to catch the eye (eg,
+to indicate emphasis in quoted conversation), and because `iroha' is a
+peculiarly Japanese ordering.  It refers to a song whose lyrics use
+all of the `50 sounds' (don't bother counting them, there aren't 50
+there---don't ask _me_ why).  This song used to be memorized by
+schoolchildren, and is still practiced by brush-writing students 
+($B=qF;(B).  This is also why the Japanese input method `Canna' used to be
+called `Iroha' (and still uses that name for its Unix-domain sockets).
+
+Modern Japanese enjoy using this sytem, but most don't remember past
+\"i ro ha\", and so must use either the `50 sounds' order or Western
+style Latin characters or Arabic numerals for long lists."
+  (funcall footnote-kana-index-function n footnote-katakana-iroha))
+
+(defconst footnote-hiragana-iroha
+  ;; this is the `marked' case; katakana are more common in this usage
+  "$B$$$m$O$K$[$X$H$A$j$L$k$r$o$+$h$?$l$=$D$M$J$i$`$&$p$N$*$/$d$^$1$U$3$($F$"$5$-$f$a$_$7$q$R$b$;$9(B"
+  "$B$R$i$,$J!"%$%m%O=g(B")
+
+(defconst footnote-hiragana-iroha-regexp
+  (concat "[" footnote-hiragana-iroha "]"))
+
+(defun Footnote-iroha-hiragana (n)
+  "($BF|K\8l(B)$B%$%m%O=g$GJ?2>L>$G;2>H$9$k$3$H!#(B
+
+Use Japanese hiragana for indexing, in `iroha' order."
+  (funcall footnote-kana-index-function n footnote-hiragana-iroha))
+
+(defconst footnote-katakana-50-sounds
+  "$B%"%$%&%(%*%+%-%/%1%3%5%7%9%;%=%?%A%D%F%H%J%K%L%M%N%O%R%U%X%[%^%_%`%a%b%d%f%h%i%j%k%l%m%o%r%s(B"
+  "$B%+%?%+%J!"8^==2;=g(B")
+
+(defconst footnote-katakana-50-sounds-regexp
+  (concat "[" footnote-katakana-50-sounds "]"))
+
+(defun Footnote-50-sounds-katakana (n)
+  "($BF|K\8l(B)$B8^==2;=g$GJR2>L>$G;2>H$9$k$3$H!#(B
+
+Use Japanese katakana for indexing, in `50 sounds' (natural) order.
+
+This really is the natural order in a linguistic sense; both the sequence
+of vowel sounds and that of consonant sounds follow a natural phonetic
+ordering corresponding to the position of the tongue in the mouth."
+  (funcall footnote-kana-index-function n footnote-katakana-50-sounds))
+
+(defconst footnote-hiragana-50-sounds
+  "$B$"$$$&$($*$+$-$/$1$3$5$7$9$;$=$?$A$D$F$H$J$K$L$M$s$*$O$R$U$X$[$^$_$`$a$b$d$f$h$i$j$k$l$m$o$r$s(B"
+  "$B$R$i$,$J!"8^==2;=g(B")
+
+(defconst footnote-hiragana-50-sounds-regexp
+  (concat "[" footnote-hiragana-50-sounds "]"))
+
+(defun Footnote-50-sounds-hiragana (n)
+  "($BF|K\8l(B)$B8^==2;=g$GJ?2>L>$G;2>H$9$k$3$H!#(B
+
+Use Japanese hiragana for indexing, in `50 sounds' order."
+  (funcall footnote-kana-index-function n footnote-hiragana-50-sounds))
+
+(setq footnote-style-alist
+      (append (list `(iroha
+		      Footnote-iroha-katakana
+		      ,footnote-katakana-iroha-regexp))
+	      footnote-style-alist))
+
+(setq footnote-style-alist
+      (append (list `(iroha-hiragana
+		      Footnote-iroha-hiragana
+		      ,footnote-hiragana-iroha-regexp))
+	      footnote-style-alist))
+
+(setq footnote-style-alist
+      (append (list `(50-sounds
+		      Footnote-50-sounds-katakana
+		      ,footnote-katakana-50-sounds-regexp))
+	      footnote-style-alist))
+
+(setq footnote-style-alist
+      (append (list `(50-sounds-hiragana
+		      Footnote-50-sounds-hiragana
+		      ,footnote-hiragana-50-sounds-regexp))
+	      footnote-style-alist))
+
+(provide 'footnote-kana)
+
+;;; footnote-kana.el ends here
+;;; footnote.el --- Footnote support for message mode
+
+;; Copyright (C) 1997 by Free Software Foundation, Inc.
+
+;; Author: Steven L Baur <steve@altair.xemacs.org>
+;; Keywords: mail, news
+;; Version: 0.18
+
+;; This file is part of XEmacs.
+
+;; XEmacs 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.
+
+;; XEmacs 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 XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
+;; This file provides footnote[1] support for message-mode in emacsen.
+;; footnote-mode is implemented as a minor mode.
+
+;; [1] Footnotes look something like this.  Along with some decorative
+;; stuff.
+
+;; TODO:
+;; Reasonable Undo support.
+;; more language styles.
+
+;;; Change Log:
+
+;; Apr-04-1997: Added option to narrow buffer when editing the text of
+;;		a footnote.
+;;		Insertion and renumbering now works.
+;;		Deletion and renumbering now works.
+;;		Footnote styles implemented.
+;; Apr-05-1997: Added dumb version of footnote-set-style.
+;;		Merged minor corrections from Hrvoje Niksic, Sudish Joseph,
+;;		and David Moore.
+;;		Remove absolute dependency on message-mode.
+;;		Replicate letters when footnote numbers hit the end of
+;;		the alphabet.
+;; Apr-06-1997: Emacs portability patches from Lars Magne Ingebrigtsen.
+;; Apr-18-1997:	Stricter matching of footnote tag.  (Idea from Colin Rafferty)
+;; May-16-1997:	Allow customization of spacing of footnote body tag.  (Idea
+;;		from Samuel Tardieu).
+
+;;; Code:
+
+(defgroup footnote nil
+  "Support for footnotes in mail and news messages."
+  :group 'message)
+
+;;;###autoload
+(defcustom footnote-mode-line-string " FN"
+  "*String to display in modes section of the mode-line."
+  :group 'footnote)
+
+(defcustom footnote-mode-hook nil
+  "*Hook functions run when footnote-mode is activated."
+  :type 'hook
+  :group 'footnote)
+
+(defcustom footnote-narrow-to-footnotes-when-editing nil
+  "*If set, narrow to footnote text body while editing a footnote."
+  :type 'boolean
+  :group 'footnote)
+
+(defcustom footnote-prompt-before-deletion t
+  "*If set, prompt before deleting a footnote.
+There is currently no way to undo deletions."
+  :type 'boolean
+  :group 'footnote)
+
+(defcustom footnote-spaced-footnotes t
+  "If set true it will put a blank line between each footnote.
+If nil, no blank line will be inserted."
+  :type 'boolean
+  :group 'footnote)
+
+(defcustom footnote-style 'numeric
+  "*Style used for footnoting.
+numeric == 1, 2, 3, ...
+english-lower == a, b, c, ...
+english-upper == A, B, C, ...
+roman-lower == i, ii, iii, iv, v, ...
+roman-upper == I, II, III, IV, V, ...
+Some versions of XEmacs and Emacs/mule may support further styles
+like 'hebrew, 'greek-lower, and 'greek-upper."
+  :type 'symbol
+  :group 'footnote)
+
+(defcustom footnote-use-message-mode t
+  "*If non-nil assume Footnoting will be done in message-mode."
+  :type 'boolean
+  :group 'footnote)
+
+(defcustom footnote-body-tag-spacing 2
+  "*Number of blanks separating a footnote body tag and its text."
+  :type 'integer
+  :group 'footnote)
+
+;;;###autoload
+(defvar footnote-prefix [(control ?c) ?!]
+  "*When not using message mode, the prefix to bind in `mode-specific-map'")
+
+;;; Interface variables that probably shouldn't be changed
+
+(defconst footnote-section-tag "Footnotes: "
+  "*Tag inserted at beginning of footnote section.")
+
+(defconst footnote-section-tag-regexp "Footnotes\\(\\[.\\]\\)?: "
+  "*Regexp which indicates the start of a footnote section.")
+
+;; The following three should be consumed by footnote styles.
+(defconst footnote-start-tag "["
+  "*String used to denote start of numbered footnote.")
+
+(defconst footnote-end-tag "]"
+  "*String used to denote end of numbered footnote.")
+
+(defvar footnote-signature-separator (if (boundp 'message-signature-separator)
+					 message-signature-separator
+				       "^-- $")
+  "*String used to recognize .signatures.")
+
+;;; Private variables
+
+(defvar footnote-style-number nil
+  "Footnote style represented as an index into footnote-style-alist.")
+(make-variable-buffer-local 'footnote-style-number)
+
+(defvar footnote-text-marker-alist nil
+  "List of markers pointing to text of footnotes in message buffer.")
+(make-variable-buffer-local 'footnote-text-marker-alist)
+
+(defvar footnote-pointer-marker-alist nil
+  "List of markers pointing to footnote pointers in message buffer.")
+(make-variable-buffer-local 'footnote-pointer-marker-alist)
+
+(defvar footnote-mouse-highlight 'highlight
+  "Text property name to enable mouse over highlight.")
+
+(defvar footnote-mode nil
+  "Variable indicating whether footnote minor mode is active.")
+(make-variable-buffer-local 'footnote-mode)
+
+;;; Default styles
+;;; NUMERIC
+(defconst footnote-numeric-regexp "[0-9]"
+  "Regexp for digits.")
+
+(defun Footnote-numeric (n)
+  "Numeric footnote style.
+Use Arabic numerals for footnoting."
+  (int-to-string n))
+
+;;; ENGLISH UPPER
+(defconst footnote-english-upper "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+  "Upper case English alphabet.")
+
+(defconst footnote-english-upper-regexp "[A-Z]"
+  "Regexp for upper case English alphabet.")
+
+(defun Footnote-english-upper (n)
+  "Upper case English footnoting.
+Wrapping around the alphabet implies successive repetitions of letters."
+  (let* ((ltr (mod (1- n) (length footnote-english-upper)))
+	 (rep (/ (1- n) (length footnote-english-upper)))
+	 (chr (char-to-string (aref footnote-english-upper ltr)))
+	 rc)
+    (while (>= rep 0)
+      (setq rc (concat rc chr))
+      (setq rep (1- rep)))
+    rc))
+  
+;;; ENGLISH LOWER
+(defconst footnote-english-lower "abcdefghijklmnopqrstuvwxyz"
+  "Lower case English alphabet.")
+
+(defconst footnote-english-lower-regexp "[a-z]"
+  "Regexp of lower case English alphabet.")
+
+(defun Footnote-english-lower (n)
+  "Lower case English footnoting.
+Wrapping around the alphabet implies successive repetitions of letters."
+  (let* ((ltr (mod (1- n) (length footnote-english-lower)))
+	 (rep (/ (1- n) (length footnote-english-lower)))
+	 (chr (char-to-string (aref footnote-english-lower ltr)))
+	 rc)
+    (while (>= rep 0)
+      (setq rc (concat rc chr))
+      (setq rep (1- rep)))
+    rc))
+
+;;; ROMAN LOWER
+(defconst footnote-roman-lower-list
+  '((1 . "i") (5 . "v") (10 . "x")
+    (50 . "l") (100 . "c") (500 . "d") (1000 . "m"))
+  "List of roman numerals with their values.")
+
+(defconst footnote-roman-lower-regexp "[ivxlcdm]"
+  "Regexp of roman numerals.")
+
+(defun Footnote-roman-lower (n)
+  "Generic Roman number footnoting."
+  (Footnote-roman-common n footnote-roman-lower-list))
+
+;;; ROMAN UPPER
+(defconst footnote-roman-upper-list
+  '((1 . "I") (5 . "V") (10 . "X")
+    (50 . "L") (100 . "C") (500 . "D") (1000 . "M"))
+  "List of roman numerals with their values.")
+
+(defconst footnote-roman-upper-regexp "[IVXLCDM]"
+  "Regexp of roman numerals.  Not complete")
+
+(defun Footnote-roman-upper (n)
+  "Generic Roman number footnoting."
+  (Footnote-roman-common n footnote-roman-upper-list))
+
+(defun Footnote-roman-common (n footnote-roman-list)
+  "Lower case Roman footnoting."
+  (let* ((our-list footnote-roman-list)
+	 (rom-lngth (length our-list))
+	 (rom-high 0)
+	 (rom-low 0)
+	 (rom-div -1)
+	 (count-high 0)
+	 (count-low 0))
+    ;; find surrounding numbers
+    (while (and (<= count-high (1- rom-lngth))
+		(>= n (car (nth count-high our-list))))
+      ;; (message "Checking %d" (car (nth count-high our-list)))
+      (setq count-high (1+ count-high)))
+    (setq rom-high count-high)
+    (setq rom-low (1- count-high))
+    ;; find the appropriate divisor (if it exists)
+    (while (and (= rom-div -1)
+		(< count-low rom-high))
+      (when (or (> n (- (car (nth rom-high our-list))
+			(/ (car (nth count-low our-list))
+			   2)))
+		(= n (- (car (nth rom-high our-list))
+			(car (nth count-low our-list)))))
+	(setq rom-div count-low))
+      ;; (message "Checking %d and %d in div loop" rom-high count-low)
+      (setq count-low (1+ count-low)))
+    ;;(message "We now have high: %d, low: %d, div: %d, n: %d"
+    ;;	       rom-high rom-low (if rom-div rom-div -1) n)
+    (let ((rom-low-pair (nth rom-low our-list))
+	  (rom-high-pair (nth rom-high our-list))
+	  (rom-div-pair (if (not (= rom-div -1)) (nth rom-div our-list) nil)))
+      ;; (message "pairs are: rom-low: %S, rom-high: %S, rom-div: %S"
+      ;;	  rom-low-pair rom-high-pair rom-div-pair)
+      (cond
+       ((< n 0) (error "Footnote-roman-common called with n < 0"))
+       ((= n 0) "")
+       ((= n (car rom-low-pair)) (cdr rom-low-pair))
+       ((= n (car rom-high-pair)) (cdr rom-high-pair))
+       ((= (car rom-low-pair) (car rom-high-pair))
+	(concat (cdr rom-low-pair)
+		(Footnote-roman-common
+		 (- n (car rom-low-pair))
+		 footnote-roman-list)))
+       ((>= rom-div 0) (concat (cdr rom-div-pair) (cdr rom-high-pair)
+			       (Footnote-roman-common
+				(- n (- (car rom-high-pair)
+					(car rom-div-pair)))
+				footnote-roman-list)))
+       (t (concat (cdr rom-low-pair)
+		  (Footnote-roman-common
+		   (- n (car rom-low-pair))
+		   footnote-roman-list)))))))
+
+;;; list of all footnote styles
+(defvar footnote-style-alist
+  `((numeric Footnote-numeric ,footnote-numeric-regexp)
+    (english-lower Footnote-english-lower ,footnote-english-lower-regexp)
+    (english-upper Footnote-english-upper ,footnote-english-upper-regexp)
+    (roman-lower Footnote-roman-lower ,footnote-roman-lower-regexp)
+    (roman-upper Footnote-roman-upper ,footnote-roman-upper-regexp))
+  "Styles of footnote tags available.
+By default only boring Arabic numbers, English letters and Roman Numerals
+are available.
+See footnote-han.el, footnote-greek.el and footnote-hebrew.el for more
+exciting styles.")
+
+;;; Style utilities & functions
+(defun Footnote-style-p (style)
+  "Return non-nil if style is a valid style known to footnote-mode."
+  (assq style footnote-style-alist))
+
+(defun Footnote-index-to-string (index)
+  "Convert a binary index into a string to display as a footnote.
+Conversion is done based upon the current selected style."
+  (let ((alist (if (Footnote-style-p footnote-style)
+		   (assq footnote-style footnote-style-alist)
+		 (nth 0 footnote-style-alist))))
+    (funcall (nth 1 alist) index)))
+
+(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))) "*"))
+
+(defun Footnote-refresh-footnotes (&optional index-regexp)
+  "Redraw all footnotes.
+You must call this or arrange to have this called after changing footnote
+styles."
+  (unless index-regexp
+    (setq index-regexp (Footnote-current-regexp)))
+  (save-excursion
+    ;; Take care of the pointers first
+    (let ((i 0) locn alist)
+      (while (setq alist (nth i footnote-pointer-marker-alist))
+	(setq locn (cdr alist))
+	(while locn
+	  (goto-char (car locn))
+	  (search-backward footnote-start-tag nil t)
+	  (when (looking-at (concat
+			     (regexp-quote footnote-start-tag)
+			     "\\(" index-regexp "\\)"
+			     (regexp-quote footnote-end-tag)))
+	    (replace-match (concat
+			    footnote-start-tag
+			    (Footnote-index-to-string (1+ i))
+			    footnote-end-tag)
+			   nil "\\1"))
+	  (setq locn (cdr locn)))
+	(setq i (1+ i))))
+
+    ;; Now take care of the text section
+    (let ((i 0) alist)
+      (while (setq alist (nth i footnote-text-marker-alist))
+	(goto-char (cdr alist))
+	(when (looking-at (concat
+			   (regexp-quote footnote-start-tag)
+			   "\\(" index-regexp "\\)"
+			   (regexp-quote footnote-end-tag)))
+	  (replace-match (concat
+			  footnote-start-tag
+			  (Footnote-index-to-string (1+ i))
+			  footnote-end-tag)
+			 nil "\\1"))
+	(setq i (1+ i))))))
+
+(defun Footnote-assoc-index (key alist)
+  "Give index of key in alist."
+  (let ((i 0) (max (length alist)) rc)
+    (while (and (null rc)
+		(< i max))
+      (when (eq key (car (nth i alist)))
+	(setq rc i))
+      (setq i (1+ i)))
+    rc))
+
+(defun Footnote-cycle-style ()
+  "Select next defined footnote style."
+  (interactive)
+  (let ((old (Footnote-assoc-index footnote-style footnote-style-alist))
+	(max (length footnote-style-alist))
+	idx)
+    (setq idx (1+ old))
+    (when (>= idx max)
+      (setq idx 0))
+    (setq footnote-style (car (nth idx footnote-style-alist)))
+    (Footnote-refresh-footnotes (nth 2 (nth old footnote-style-alist)))))
+
+(defun Footnote-set-style (&optional style)
+  "Select a specific style."
+  (interactive
+   (list (intern (completing-read
+		  "Footnote Style: "
+		  obarray #'Footnote-style-p 'require-match))))
+  (setq footnote-style style))
+
+;; Internal functions
+(defun Footnote-insert-numbered-footnote (arg &optional mousable)
+  "Insert numbered footnote at (point)."
+  (let* ((start (point))
+	 (end (progn
+		(insert-before-markers (concat footnote-start-tag
+					       (Footnote-index-to-string arg)
+					       footnote-end-tag))
+		(point))))
+
+    (add-text-properties start end
+			 (list 'footnote-number arg))
+    (when mousable
+      (add-text-properties start end
+			   (list footnote-mouse-highlight t)))))
+
+(defun Footnote-renumber (from to pointer-alist text-alist)
+  "Renumber a single footnote."
+  (let* ((posn-list (cdr pointer-alist)))
+    (setcar pointer-alist to)
+    (setcar text-alist to)
+    (while posn-list
+      (goto-char (car posn-list))
+      (search-backward footnote-start-tag nil t)
+      (when (looking-at (format "%s%s%s"
+				(regexp-quote footnote-start-tag)
+				(Footnote-current-regexp)
+				(regexp-quote footnote-end-tag)))
+	(add-text-properties (match-beginning 0) (match-end 0)
+			     (list 'footnote-number to))
+	(replace-match (format "%s%s%s"
+			       footnote-start-tag
+			       (Footnote-index-to-string to)
+			       footnote-end-tag)))
+      (setq posn-list (cdr posn-list)))
+    (goto-char (cdr text-alist))
+    (when (looking-at (format "%s%s%s"
+			      (regexp-quote footnote-start-tag)
+			      (Footnote-current-regexp)
+			      (regexp-quote footnote-end-tag)))
+      (add-text-properties (match-beginning 0) (match-end 0)
+			   (list 'footnote-number to))
+      (replace-match (format "%s%s%s"
+			     footnote-start-tag
+			     (Footnote-index-to-string to)
+			     footnote-end-tag) nil t))))
+
+;; Not needed?
+(defun Footnote-narrow-to-footnotes ()
+  "Restrict text in buffer to show only text of footnotes."
+  (interactive)	; testing
+  (goto-char (point-max))
+  (when (re-search-backward footnote-signature-separator nil t)
+    (let ((end (point)))
+      (when (re-search-backward (concat "^" footnote-section-tag-regexp) nil t)
+	(narrow-to-region (point) end)))))
+
+(defun Footnote-goto-char-point-max ()
+  "Move to end of buffer or prior to start of .signature."
+  (goto-char (point-max))
+  (or (re-search-backward footnote-signature-separator nil t)
+      (point)))
+
+(defun Footnote-insert-text-marker (arg locn)
+  "Insert a marker pointing to footnote arg, at buffer location locn."
+  (let ((marker (make-marker)))
+    (unless (assq arg footnote-text-marker-alist)
+      (set-marker marker locn)
+      (setq footnote-text-marker-alist
+	    (acons arg marker footnote-text-marker-alist))
+      (setq footnote-text-marker-alist
+	    (Footnote-sort footnote-text-marker-alist)))))
+
+(defun Footnote-insert-pointer-marker (arg locn)
+  "Insert a marker pointing to footnote arg, at buffer location locn."
+  (let ((marker (make-marker))
+	alist)
+    (set-marker marker locn)
+    (if (setq alist (assq arg footnote-pointer-marker-alist))
+	(setf alist
+	      (cons marker (cdr alist)))
+      (setq footnote-pointer-marker-alist
+	    (acons arg (list marker) footnote-pointer-marker-alist))
+      (setq footnote-pointer-marker-alist
+	    (Footnote-sort footnote-pointer-marker-alist)))))
+
+(defun Footnote-insert-footnote (arg)
+  "Insert a footnote numbered arg, at (point)."
+  (push-mark)
+  (Footnote-insert-pointer-marker arg (point))
+  (Footnote-insert-numbered-footnote arg t)
+  (Footnote-goto-char-point-max)
+  (if (re-search-backward (concat "^" footnote-section-tag-regexp) nil t)
+      (save-restriction
+	(when footnote-narrow-to-footnotes-when-editing 
+	  (Footnote-narrow-to-footnotes))
+	(Footnote-goto-footnote (1- arg)) ; evil, FIXME (less evil now)
+	;; (message "Inserting footnote %d" arg)
+	(unless
+	    (or (eq arg 1)
+		(when (re-search-forward
+		       (if footnote-spaced-footnotes
+			   "\n\n"
+			 (concat "\n"
+				 (regexp-quote footnote-start-tag)
+				 (Footnote-current-regexp)
+				 (regexp-quote footnote-end-tag)))
+		       nil t)
+		  (unless (beginning-of-line) t))
+		(goto-char (point-max)))))
+    (unless (looking-at "^$")
+      (insert "\n"))
+    (when (eobp)
+      (insert "\n"))
+    (insert footnote-section-tag "\n"))
+  (let ((old-point (point)))
+    (Footnote-insert-numbered-footnote arg nil)
+    (Footnote-insert-text-marker arg old-point)))
+
+(defun Footnote-sort (list)
+  (sort list (lambda (e1 e2)
+	       (< (car e1) (car e2)))))
+
+(defun Footnote-text-under-cursor ()
+  "Return the number of footnote if in footnote text.
+Nil is returned if the cursor is not positioned over the text of
+a footnote."
+  (when (and (let ((old-point (point)))
+	       (save-excursion
+		 (save-restriction
+		   (Footnote-narrow-to-footnotes)
+		   (and (>= old-point (point-min))
+			(<= old-point (point-max))))))
+	     (>= (point) (cdar footnote-text-marker-alist)))
+    (let ((i 1)
+	  alist-txt rc)
+      (while (and (setq alist-txt (nth i footnote-text-marker-alist))
+		  (null rc))
+	(when (< (point) (cdr alist-txt))
+	  (setq rc (car (nth (1- i) footnote-text-marker-alist))))
+	(setq i (1+ i)))
+      (when (and (null rc)
+		 (null alist-txt))
+	(setq rc (car (nth (1- i) footnote-text-marker-alist))))
+      rc)))
+
+(defun Footnote-under-cursor ()
+  "Return the number of the footnote underneath the cursor.
+Nil is returned if the cursor is not over a footnote."
+  (or (get-text-property (point) 'footnote-number)
+      (Footnote-text-under-cursor)))
+
+;;; User functions
+
+(defun Footnote-make-hole ()
+  (save-excursion
+    (let ((i 0)
+	  (notes (length footnote-pointer-marker-alist))
+	  alist-ptr alist-txt rc)
+      (while (< i notes)
+	(setq alist-ptr (nth i footnote-pointer-marker-alist))
+	(setq alist-txt (nth i footnote-text-marker-alist))
+	(when (< (point) (- (cadr alist-ptr) 3))
+	  (unless rc
+	    (setq rc (car alist-ptr)))
+	  (save-excursion
+	    (message (concat "Renumbering from "
+			     (car alist-ptr) " to " (1+ (car alist-ptr))))
+	    (Footnote-renumber (car alist-ptr)
+			       (1+ (car alist-ptr))
+			       alist-ptr
+			       alist-txt)))
+	(setq i (1+ i)))
+      rc)))
+
+;;;###autoload
+(defun Footnote-add-footnote (&optional arg)
+  "Add a numbered footnote.
+The number the footnote receives is dependent upon the relative location
+of any other previously existing footnotes.
+If the variable `footnote-narrow-to-footnotes-when-editing' is set,
+the buffer is narrowed to the footnote body.  The restriction is removed
+by using `Footnote-back-to-message'."
+  (interactive "*P")
+  (let (num)
+    (if footnote-text-marker-alist
+	(if (< (point) (cadar (last footnote-pointer-marker-alist)))
+	    (setq num (Footnote-make-hole))
+	  (setq num (1+ (caar (last footnote-text-marker-alist)))))
+      (setq num 1))
+    (message "Adding footnote %d" num)
+    (Footnote-insert-footnote num)
+    (insert-before-markers (make-string footnote-body-tag-spacing ? ))
+    (let ((opoint (point)))
+      (save-excursion
+	(insert-before-markers
+	 (if footnote-spaced-footnotes
+	     "\n\n"
+	   "\n"))
+	(when footnote-narrow-to-footnotes-when-editing
+	  (Footnote-narrow-to-footnotes)))
+      ;; Emacs/XEmacs bug?  save-excursion doesn't restore point when using
+      ;; insert-before-markers.
+      (goto-char opoint))))
+
+(defun Footnote-delete-footnote (&optional arg)
+  "Delete a numbered footnote.
+With no parameter, delete the footnote under (point).  With arg specified,
+delete the footnote with that number."
+  (interactive "*P")
+  (unless arg
+    (setq arg (Footnote-under-cursor)))
+  (when (and arg
+	     (or (not footnote-prompt-before-deletion)
+		 (y-or-n-p (format "Really delete footnote %d?" arg))))
+    (let (alist-ptr alist-txt locn)
+      (setq alist-ptr (assq arg footnote-pointer-marker-alist))
+      (setq alist-txt (assq arg footnote-text-marker-alist))
+      (unless (and alist-ptr alist-txt)
+	(error "Can't delete footnote %d" arg))
+      (setq locn (cdr alist-ptr))
+      (while (car locn)
+	(save-excursion
+	  (goto-char (car locn))
+	  (let* ((end (point))
+		 (start (search-backward footnote-start-tag nil t)))
+	    (kill-region start end)))
+	(setq locn (cdr locn)))
+      (save-excursion
+	(goto-char (cdr alist-txt))
+	(kill-region (point) (search-forward "\n\n" nil t)))
+      (setq footnote-pointer-marker-alist
+	    (delq alist-ptr footnote-pointer-marker-alist))
+      (setq footnote-text-marker-alist
+	    (delq alist-txt footnote-text-marker-alist))
+      (Footnote-renumber-footnotes)
+      (when (and (null footnote-text-marker-alist)
+		 (null footnote-pointer-marker-alist))
+	(save-excursion
+	  (let* ((end (Footnote-goto-char-point-max))
+		 (start (1- (re-search-backward
+			     (concat "^" footnote-section-tag-regexp)
+			     nil t))))
+	    (forward-line -1)
+	    (when (looking-at "\n")
+	      (kill-line))
+	    (kill-region start (if (< end (point-max))
+				   end
+				 (point-max)))))))))
+
+(defun Footnote-renumber-footnotes (&optional arg)
+  "Renumber footnotes, starting from 1."
+  (interactive "*P")
+  (save-excursion
+    (let ((i 0)
+	  (notes (length footnote-pointer-marker-alist))
+	  alist-ptr alist-txt)
+      (while (< i notes)
+	(setq alist-ptr (nth i footnote-pointer-marker-alist))
+	(setq alist-txt (nth i footnote-text-marker-alist))
+	(unless (eq (1+ i) (car alist-ptr))
+	  (Footnote-renumber (car alist-ptr) (1+ i) alist-ptr alist-txt))
+	(setq i (1+ i))))))
+
+(defun Footnote-goto-footnote (&optional arg)
+  "Jump to the text of a footnote.
+With no parameter, jump to the text of the footnote under (point).  With arg
+specified, jump to the text of that footnote."
+  (interactive "P")
+  (setq zmacs-region-stays t)
+  (let (footnote)
+    (if arg
+	(setq footnote (assq arg footnote-text-marker-alist))
+      (when (setq arg (Footnote-under-cursor))
+	(setq footnote (assq arg footnote-text-marker-alist))))
+    (if footnote
+	(goto-char (cdr footnote))
+      (if (= arg 0)
+	  (progn
+	    (goto-char (point-max))
+	    (re-search-backward (concat "^" footnote-section-tag-regexp))
+	    (forward-line 1))
+	(error "I don't see a footnote here.")))))
+
+(defun Footnote-back-to-message (&optional arg)
+  "Move cursor back to footnote referent.
+If the cursor is not over the text of a footnote, point is not changed.
+If the buffer was narrowed due to `footnote-narrow-to-footnotes-when-editing'
+being set it is automatically widened."
+  (interactive "P")
+  (setq zmacs-region-stays t)
+  (let ((note (Footnote-text-under-cursor)))
+    (when note
+      (when footnote-narrow-to-footnotes-when-editing
+	(widen))
+      (goto-char (cadr (assq note footnote-pointer-marker-alist))))))
+
+;;;###autoload
+(defvar footnote-mode-map nil
+  "Keymap used for footnote minor mode.")
+
+;; Set up our keys
+;;;###autoload
+(unless footnote-mode-map
+  (setq footnote-mode-map (make-sparse-keymap))
+  (define-key footnote-mode-map "a" 'Footnote-add-footnote)
+  (define-key footnote-mode-map "b" 'Footnote-back-to-message)
+  (define-key footnote-mode-map "c" 'Footnote-cycle-style)
+  (define-key footnote-mode-map "d" 'Footnote-delete-footnote)
+  (define-key footnote-mode-map "g" 'Footnote-goto-footnote)
+  (define-key footnote-mode-map "r" 'Footnote-renumber-footnotes)
+  (define-key footnote-mode-map "s" 'Footnote-set-style))
+
+;;;###autoload
+(defvar footnote-minor-mode-map nil
+  "Keymap used for binding footnote minor mode.")
+
+;;;###autoload
+(unless footnote-minor-mode-map
+  (define-key global-map footnote-prefix footnote-mode-map))
+
+;;;###autoload
+(defun footnote-mode (&optional arg)
+  "Toggle footnote minor mode.
+\\<message-mode-map>
+key		binding
+---		-------
+
+\\[Footnote-renumber-footnotes]		Footnote-renumber-footnotes
+\\[Footnote-goto-footnote]		Footnote-goto-footnote
+\\[Footnote-delete-footnote]		Footnote-delete-footnote
+\\[Footnote-cycle-style]		Footnote-cycle-style
+\\[Footnote-back-to-message]		Footnote-back-to-message
+\\[Footnote-add-footnote]		Footnote-add-footnote
+"
+  (interactive "*P")
+  ;; (filladapt-mode t)
+  (setq zmacs-region-stays t)
+  (setq footnote-mode
+	(if (null arg) (not footnote-mode)
+	  (> (prefix-numeric-value arg) 0)))
+  (when footnote-mode
+    ;; (Footnote-setup-keybindings)
+    (make-local-variable 'footnote-style)
+    (if (fboundp 'force-mode-line-update)
+	(force-mode-line-update)
+      (set-buffer-modified-p (buffer-modified-p)))
+
+    (when (boundp 'filladapt-token-table)
+      ;; add tokens to filladapt to match footnotes
+      ;; 1] xxxxxxxxxxx x x x or [1] x x x x x x x
+      ;;    xxx x xx xxx xxxx	     x x x xxxxxxxxxx
+      (let ((bullet-regexp (concat (regexp-quote footnote-start-tag)
+				   "?[0-9a-zA-Z]+"
+				   (regexp-quote footnote-end-tag)
+				   "[ \t]")))
+	(unless (assoc bullet-regexp filladapt-token-table)
+	  (setq filladapt-token-table
+		(append filladapt-token-table
+			(list (list bullet-regexp 'bullet)))))))
+
+    (run-hooks 'footnote-mode-hook)))
+
+;; install on minor-mode-alist
+;;;###autoload
+(when (fboundp 'add-minor-mode)
+    ;; XEmacs
+    (add-minor-mode 'footnote-mode
+		    footnote-mode-line-string
+		    footnote-minor-mode-map))
+
+;; Emacs -- don't autoload
+(unless (assq 'footnote-mode minor-mode-alist)
+  (setq minor-mode-alist
+	(append minor-mode-alist
+		'(footnote-mode 'footnote-mode-line-string))))
+
+(provide 'footnote)
+
+;;; footnote.el ends here

File package-info.in

+(footnote
+  (version VERSION
+   description "Footnoting in mail message editing modes."
+   filename FILENAME
+   md5sum MD5SUM
+   size SIZE
+   provides (footnote)
+   requires (REQUIRES)
+   type regular
+))