all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Boruch Baum <boruch_baum@gmx.com>
To: 29759@debbugs.gnu.org
Subject: bug#29759: 25.2 Updated Code
Date: Mon, 18 Dec 2017 10:41:02 -0500	[thread overview]
Message-ID: <20171218154101.sobgpnm6cvxpfk32@E15-2016.optimum.net> (raw)
In-Reply-To: <20171217213114.mti6zqnlsibvaqj7@E15-2016.optimum.net>

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

Thie code update renames the style to 'hebrew-numeric', adds a second
(rarely used) style, and comments a failed attempt to improve the style
regex.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0

[-- Attachment #2: 25.2 Hebrew footnote styles: Updated Code --]
[-- Type: text/plain, Size: 1936 bytes --]

(defconst footnote-hebrew-numeric-regex "[אבגדהוזחטיכלמנסעפצקרשת']+")
; (defconst footnote-hebrew-numeric-regex "\\([אבגדהוזחט]'\\)?\\(ת\\)?\\(ת\\)?\\([קרשת]\\)?\\([טיכלמנסעפצ]\\)?\\([אבגדהוזחט]\\)?")
(defconst footnote-hebrew-numeric '(
  ("א" "ב" "ג" "ד" "ה" "ו" "ז" "ח" "ט")
  ("י" "כ" "ל" "מ" "נ" "ס" "ע" "פ" "צ")
  ("ק" "ר" "ש" "ת" "תק" "תר"" תש" "תת" "תתק")))
(defun Footnote-hebrew-numeric(n)
  "Supports 9999 footnotes, then rolls over."
  (let*
    ((n (+ (mod n 10000) (/ n 10000)))
     (thousands (/ n 1000))
     (hundreds (/ (mod n 1000) 100))
     (tens (/ (mod n 100) 10))
     (units (mod n 10))
     (special (if (not (= tens 1)) nil
               (or (when (= units 5) "טו")
               (when (= units 6) "טז")))))
   (concat
     (when (/= 0 thousands) (concat (nth (1- thousands) (nth 0 footnote-hebrew-numeric)) "'"))
     (when (/= 0 hundreds) (nth (1- hundreds) (nth 2 footnote-hebrew-numeric)))
     (if special special
      (concat
        (when (/= 0 tens) (nth (1- tens) (nth 1 footnote-hebrew-numeric)))
        (when (/= 0 units) (nth (1- units) (nth 0 footnote-hebrew-numeric))))))))
(add-to-list 'footnote-style-alist `(hebrew-numeric Footnote-hebrew-numeric ,footnote-hebrew-numeric-regex) t)

(defconst footnote-hebrew-symbolic-regex "[אבגדהוזחטיכלמנסעפצקרשת]")
(defconst footnote-hebrew-symbolic '(
 "א" "ב" "ג" "ד" "ה" "ו" "ז" "ח" "ט" "י" "כ" "ל" "מ" "נ" "ס" "ע" "פ" "צ" "ק" "ר" "ש" "ת"))
(defun Footnote-hebrew-symbolic(n)
  "Only 22 elements, per the style of eg. 'פירוש שפתי חכמים על רש\"י'.
Proceeds from `י' to `כ', from `צ' to `ק'. After `ת', rolls over to `א'."
  (nth (mod (1- n) 22) footnote-hebrew-symbolic))
(add-to-list 'footnote-style-alist `(hebrew-symbolic Footnote-hebrew-symbolic ,footnote-hebrew-symbolic-regex) t)

  reply	other threads:[~2017-12-18 15:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-17 21:31 bug#29759: 25.2; "exciting footnote styles" promised, but unavailable Boruch Baum
2017-12-18 15:41 ` Boruch Baum [this message]
2017-12-22 14:44 ` Eli Zaretskii
2017-12-24 20:02   ` Boruch Baum
2017-12-25 16:00     ` Eli Zaretskii
2017-12-25 18:20       ` Boruch Baum

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=20171218154101.sobgpnm6cvxpfk32@E15-2016.optimum.net \
    --to=boruch_baum@gmx.com \
    --cc=29759@debbugs.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.