all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Any objection to adding a unicode footnote style? (encoding fixed)
Date: Mon, 09 May 2011 12:26:55 +0800	[thread overview]
Message-ID: <m1d3jsijn4.fsf_-_@th041156.ip.tsinghua.edu.cn> (raw)
In-Reply-To: 83k4e1jesg.fsf@gnu.org

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

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


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

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


  reply	other threads:[~2011-05-09  4:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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       ` Leo [this message]
2011-05-09  7:06         ` Any objection to adding a unicode footnote style? (encoding fixed) 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1d3jsijn4.fsf_-_@th041156.ip.tsinghua.edu.cn \
    --to=sdl.web@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.