From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Any objection to adding a unicode footnote style? Date: Sun, 08 May 2011 18:11:47 +0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1304849537 12206 80.91.229.12 (8 May 2011 10:12:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 8 May 2011 10:12:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 08 12:12:12 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QJ0y9-0007ih-JP for ged-emacs-devel@m.gmane.org; Sun, 08 May 2011 12:12:09 +0200 Original-Received: from localhost ([::1]:51218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ0y8-0000nF-RK for ged-emacs-devel@m.gmane.org; Sun, 08 May 2011 06:12:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ0y5-0000n9-PO for emacs-devel@gnu.org; Sun, 08 May 2011 06:12:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJ0y4-0005mq-Lf for emacs-devel@gnu.org; Sun, 08 May 2011 06:12:05 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:36904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ0y4-0005mm-7L for emacs-devel@gnu.org; Sun, 08 May 2011 06:12:04 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QJ0y2-0007e1-Cn for emacs-devel@gnu.org; Sun, 08 May 2011 12:12:02 +0200 Original-Received: from th041156.ip.tsinghua.edu.cn ([59.66.41.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 May 2011 12:12:02 +0200 Original-Received: from sdl.web by th041156.ip.tsinghua.edu.cn with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 May 2011 12:12:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 90 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: th041156.ip.tsinghua.edu.cn Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAMFBMVEUaFRZLMy1dTENxVzKQ WiCrXQ97cmO/dSqSh3akjGTApXy5sJ7Sxo/Sz8Xo6eP9//xJbkruAAAAAWJLR0QAiAUdSAAAAAlw SFlzAAACxQAAAsUBidZ/7wAAAAd0SU1FB9cBBwMJOwHXewoAAAIBSURBVCjPVdNBiNNAFADQ6J4F x3hThHZBBC+WCFI8SS0iezRDcMHLHkLAg6gJH/fgYQ9xYlj2sLK4KHgqCgXFhda2Idmr4kkQPZQ0 nkQMbTypbMmMM2m7ZgYSmMef/5OZPwo7HFnx3uKPcmj0Dht1LWZJ+Hvr7dIFZXRUwl9VRTuuKDJ+ U44gjscknK4hhJaCkYRsWjmBtLqXlJAG2wipNe18OZJu1BBq1E8xafl4s6Jq2mUZGftU1y7CCxnp FVUDWJXx4C66BKBnErbuoaYNtoRTu6EZBsCbMn7W+5qOAR6WvxNOby9jHWC9hAf3n304CdiAByXs 3Nh9roLDkyb/sWV712vYwaLSAn8CPMHIAAzOPDKP2COAFm4Y4ODVWc6xG7KXsN7UeUJjjimx2uwd gCgNhr0i8C/xyCD5CiCKAMY3Bf5oDzx//w/fimscdcAZU2jv9sedx6+nYPPFIoWI/GK6QZ+EFGOR ErAjCnV3vPZ7XqlTIMbOLY7fLcvvmT7rXNWaGDexIY44N12TG2PDp7vqyl57dnCeuWwyNpnEURxk fTbDYeBnKRn4oejPYI4sH6WviBumEZ/GxX4X/x6EcURFZ7E071bjQGAxpcOAEOJuTiroDEea5Szv rVWLYfl7ZiQwSUToxrkux7OLixAWGz22+HIyWTRYcVfomOwvzusfjtVIGgLHf3MAAAAASUVORK5C YII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.7) Cancel-Lock: sha1:ln7vguGT2P0XigcqHulYM4r7ids= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139221 Archived-At: --=-=-= Content-Type: text/plain Any objection to adding a new style `unicode' to footnote-mode? Leo --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-Add-unicode-footnote-style.patch Content-Transfer-Encoding: 8bit >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 --=-=-=--