Emacs Hebrew footnotes [CODE SNIPPET]

Emacs Hebrew footnotes [CODE SNIPPET]

Shay Gover govershay at gmail.com
Mon Dec 18 16:16:35 IST 2017


On Sun, Dec 17, 2017 at 11:40 PM, Boruch Baum <boruch_baum at gmx.com> wrote:

> ref: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29759
>
> I honestly don't remember if ever in the past I've used Hebrew footnote
> numbering in emacs, but the current state of affairs is that although the
> documentation indicates that the option is available, the file seems
> nowhere to be found. The above reference reports the issue, and includes
> the following code snippet, so if anyone has an improvement, please post
> it there first.
>
> (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)
>
>
> --
> hkp://keys.gnupg.net
> CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20171218/301e40d2/attachment.html>


More information about the Linux-il mailing list