all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#29759: 25.2; "exciting footnote styles" promised, but unavailable
@ 2017-12-17 21:31 Boruch Baum
  2017-12-18 15:41 ` bug#29759: 25.2 Updated Code Boruch Baum
  2017-12-22 14:44 ` bug#29759: 25.2; "exciting footnote styles" promised, but unavailable Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Boruch Baum @ 2017-12-17 21:31 UTC (permalink / raw)
  To: 29759

The docstring for variable `footnote-style-alist' promises, "See
footnote-han.el, footnote-greek.el and footnote-hebrew.el for more
exciting styles"; However, those files neither seem to be installed with
emacs, nor appear when I perform a google search for them.

Attached is a patch for Hebrew footnotes, for the benefit of all who
might be 'excited' by such things. For the rest of us, please consider
providing / restoring those files to emacs, or consider applying this
code.


(defconst footnote-hebrew-regex "[אבגדהוזחטיכלמנסעפצקרשת]+")
(defconst footnote-hebrew '(
  ("א" "ב" "ג" "ד" "ה" "ו" "ז" "ח" "ט")
  ("י" "כ" "ל" "מ" "נ" "ס" "ע" "פ" "צ")
  ("ק" "ר" "ש" "ת" "תק" "תר"" תש" "תת" "תתק")))
(defun Footnote-hebrew(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)) "'"))
     (when (/= 0 hundreds) (nth (1- hundreds) (nth 2 footnote-hebrew)))
     (if special special
      (concat
        (when (/= 0 tens) (nth (1- tens) (nth 1 footnote-hebrew)))
        (when (/= 0 units) (nth (1- units) (nth 0 footnote-hebrew))))))))
(add-to-list 'footnote-style-alist `(hebrew Footnote-hebrew ,footnote-hebrew-regex) t)


VERSION INFORMATION
===================
In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.20)
 of 2017-09-11, modified by Debian built on trouble
System Description:	Devuan GNU/Linux 1.0 (jessie)

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





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

end of thread, other threads:[~2017-12-25 18:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-17 21:31 bug#29759: 25.2; "exciting footnote styles" promised, but unavailable Boruch Baum
2017-12-18 15:41 ` bug#29759: 25.2 Updated Code Boruch Baum
2017-12-22 14:44 ` bug#29759: 25.2; "exciting footnote styles" promised, but unavailable Eli Zaretskii
2017-12-24 20:02   ` Boruch Baum
2017-12-25 16:00     ` Eli Zaretskii
2017-12-25 18:20       ` Boruch Baum

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.