summaryrefslogtreecommitdiff
path: root/lisp/mail/footnote.el
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2011-05-10 16:20:21 +0800
committerLeo Liu <sdl.web@gmail.com>2011-05-10 16:20:21 +0800
commitb40448691347ceef93c4bba74a623c61fcbc19a1 (patch)
treedf8c445aaead1109afb332fa57a0d4c12fe20526 /lisp/mail/footnote.el
parent9e2dd53f1654b39fd8b9732e57fd29b913988ecc (diff)
downloademacs-b40448691347ceef93c4bba74a623c61fcbc19a1.tar.gz
emacs-b40448691347ceef93c4bba74a623c61fcbc19a1.tar.bz2
emacs-b40448691347ceef93c4bba74a623c61fcbc19a1.zip
Add a new footnote style unicode
See also the discussion thread in: http://thread.gmane.org/gmane.emacs.devel/139221
Diffstat (limited to 'lisp/mail/footnote.el')
-rw-r--r--lisp/mail/footnote.el26
1 files changed, 25 insertions, 1 deletions
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index c225e4263a8..8dac3be0e5f 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -291,6 +291,25 @@ Use a range of Latin-1 non-ASCII characters for footnoting."
(string (aref footnote-latin-string
(mod (1- n) (length footnote-latin-string)))))
+;; Unicode
+
+(defconst footnote-unicode-string "⁰¹²³⁴⁵⁶⁷⁸⁹"
+ "String of unicode footnoting characters.")
+
+(defconst footnote-unicode-regexp (concat "[" footnote-unicode-string "]+")
+ "Regexp for unicode footnoting characters.")
+
+(defun Footnote-unicode (n)
+ "Unicode footnote style.
+Use unicode characters for footnoting."
+ (let (modulus result done)
+ (while (not done)
+ (setq modulus (mod n 10)
+ n (truncate n 10))
+ (and (zerop n) (setq done t))
+ (push (aref footnote-unicode-string modulus) result))
+ (apply #'string result)))
+
;;; list of all footnote styles
(defvar footnote-style-alist
`((numeric Footnote-numeric ,footnote-numeric-regexp)
@@ -298,7 +317,8 @@ Use a range of Latin-1 non-ASCII characters for footnoting."
(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)
- (latin Footnote-latin ,footnote-latin-regexp))
+ (latin Footnote-latin ,footnote-latin-regexp)
+ (unicode Footnote-unicode ,footnote-unicode-regexp))
"Styles of footnote tags available.
By default only boring Arabic numbers, English letters and Roman Numerals
are available.
@@ -313,8 +333,12 @@ english-upper == A, B, C, ...
roman-lower == i, ii, iii, iv, v, ...
roman-upper == I, II, III, IV, V, ...
latin == ¹ ² ³ º ª § ¶
+unicode == ¹, ², ³, ...
See also variables `footnote-start-tag' and `footnote-end-tag'.
+Note: some characters in the unicode style may not show up
+properly if the default font does not contain those characters.
+
Customizing this variable has no effect on buffers already
displaying footnotes. To change the style of footnotes in such a
buffer use the command `Footnote-set-style'."