unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Any objection to adding a unicode footnote style?
@ 2011-05-08 10:11 Leo
  2011-05-08 14:30 ` Eli Zaretskii
  0 siblings, 1 reply; 23+ messages in thread
From: Leo @ 2011-05-08 10:11 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

Any objection to adding a new style `unicode' to footnote-mode?

Leo


[-- Attachment #2: 0001-Add-unicode-footnote-style.patch --]
[-- Type: text/x-diff, Size: 2866 bytes --]

From ff273b1cd36f9357d531dbb490008d13a2043bd9 Mon Sep 17 00:00:00 2001
Date: Thu, 5 May 2011 17:10:02 +0800
Subject: [PATCH] Add unicode footnote style

---
 lisp/mail/footnote.el |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index 82928642..fdeeb483 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -1,4 +1,4 @@
-;;; footnote.el --- footnote support for message mode  -*- coding: iso-latin-1;-*-
+;;; footnote.el --- footnote support for message mode  -*- coding: utf-8;-*-
 
 ;; Copyright (C) 1997, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
@@ -279,7 +279,7 @@ (defun Footnote-roman-common (n footnote-roman-list)
 
 ;; Latin-1
 
-(defconst footnote-latin-string "ケイウコェァカ"
+(defconst footnote-latin-string "ツケツイツウツコツェツァツカ"
   "String of Latin-1 footnoting characters.")
 
 ;; Note not [...]+, because this style cycles.
@@ -292,6 +292,23 @@ (defun Footnote-latin (n)
   (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)
+  (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)
@@ -299,7 +316,8 @@ (defvar footnote-style-alist
     (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,7 +331,8 @@ (defcustom footnote-style 'numeric
 english-upper == A, B, C, ...
 roman-lower == i, ii, iii, iv, v, ...
 roman-upper == I, II, III, IV, V, ...
-latin == ケ イ ウ コ ェ ァ カ
+latin == ツケ ツイ ツウ ツコ ツェ ツァ ツカ
+unicode == ツケ, ツイ, ツウ, ...
 See also variables `footnote-start-tag' and `footnote-end-tag'.
 
 Customizing this variable has no effect on buffers already
-- 
1.7.5-rc2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2011-05-10 10:53 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-08 10:11 Any objection to adding a unicode footnote style? Leo
2011-05-08 14:30 ` Eli Zaretskii
2011-05-08 16:43   ` Leo
2011-05-08 17:14     ` Eli Zaretskii
2011-05-09  4:26       ` Any objection to adding a unicode footnote style? (encoding fixed) Leo
2011-05-09  7:06         ` Eli Zaretskii
2011-05-09 15:39           ` Ted Zlatanov
2011-05-09 16:05             ` Eli Zaretskii
2011-05-09 16:22               ` Ted Zlatanov
2011-05-09 16:50                 ` Alp Aker
2011-05-09 17:01                   ` Eli Zaretskii
2011-05-09 17:06                     ` Alp Aker
2011-05-09 17:28                       ` Eli Zaretskii
2011-05-09 18:10                         ` Alp Aker
2011-05-09 18:21                           ` Alp Aker
2011-05-09 17:22                     ` Alp Aker
2011-05-09 16:55                 ` Eli Zaretskii
2011-05-09 17:20                   ` Ted Zlatanov
2011-05-09 17:27                     ` Leo
2011-05-09 17:50                       ` Ted Zlatanov
2011-05-10  5:09           ` Leo
2011-05-10  7:31             ` Eli Zaretskii
2011-05-10 10:53               ` Leo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).