From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: Any objection to adding a unicode footnote style? (encoding fixed) Date: Mon, 09 May 2011 12:26:55 +0800 Message-ID: References: <83oc3djmda.fsf@gnu.org> <83k4e1jesg.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1304915240 16858 80.91.229.12 (9 May 2011 04:27:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 May 2011 04:27:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 09 06:27:16 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 1QJI3u-0002YY-PJ for ged-emacs-devel@m.gmane.org; Mon, 09 May 2011 06:27:15 +0200 Original-Received: from localhost ([::1]:42089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJI3u-00019e-6n for ged-emacs-devel@m.gmane.org; Mon, 09 May 2011 00:27:14 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJI3s-00019Z-5V for emacs-devel@gnu.org; Mon, 09 May 2011 00:27:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJI3r-0005AZ-9h for emacs-devel@gnu.org; Mon, 09 May 2011 00:27:12 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:38502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJI3q-0005AP-R1 for emacs-devel@gnu.org; Mon, 09 May 2011 00:27:11 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QJI3n-0002Wo-Qo for emacs-devel@gnu.org; Mon, 09 May 2011 06:27:07 +0200 Original-Received: from 123.114.50.27 ([123.114.50.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 May 2011 06:27:07 +0200 Original-Received: from sdl.web by 123.114.50.27 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 May 2011 06:27:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 82 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 123.114.50.27 Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.7) Cancel-Lock: sha1:RAchtTEkHV2/rSAmNPbZIAoXeVg= 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:139238 Archived-At: --=-=-= Content-Type: text/plain On 2011-05-09 01:14 +0800, Eli Zaretskii wrote: [elide 5 lines] > That's what I did. Sorry for sending a diff with mixed encodings. It is now split into two parts: 1. convert footnote.el to utf-8 2. diff (attached) Leo --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Add-a-new-footnote-style-unicode.patch Content-Transfer-Encoding: 8bit >From d889e335e5587e1162cd2b4240c8239fabac4ce5 Mon Sep 17 00:00:00 2001 Date: Mon, 9 May 2011 12:22:13 +0800 Subject: [PATCH] Add a new footnote style `unicode' --- lisp/mail/footnote.el | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index c9899ca7..dc967ec8 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el @@ -292,6 +292,25 @@ (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) + "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) @@ -299,7 +318,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. @@ -314,6 +334,7 @@ (defcustom footnote-style 'numeric 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'. Customizing this variable has no effect on buffers already -- 1.7.5-rc2 --=-=-=--