䷘ Innocence
This commit is contained in:
parent
82ea898a5e
commit
2f1e8393b0
2 changed files with 35 additions and 20 deletions
|
@ -12,6 +12,7 @@ The (first) appearance of anything (as a bud) is what we call a semblance; when
|
||||||
#+END_QUOTE
|
#+END_QUOTE
|
||||||
|
|
||||||
** Install & configure
|
** Install & configure
|
||||||
|
[[https://melpa.org/#/i-ching][file:https://melpa.org/packages/i-ching-badge.svg]]
|
||||||
|
|
||||||
The package can be installed from [[https://melpa.org/#/i-ching][MELPA]] or manually via [[https://github.com/zzkt/i-ching][github]].
|
The package can be installed from [[https://melpa.org/#/i-ching][MELPA]] or manually via [[https://github.com/zzkt/i-ching][github]].
|
||||||
|
|
||||||
|
|
54
i-ching.el
54
i-ching.el
|
@ -83,30 +83,42 @@
|
||||||
(symbol :tag "Use bespoke random numbers from random.org" random)
|
(symbol :tag "Use bespoke random numbers from random.org" random)
|
||||||
(symbol :tag "Use Genuine Quantum Randomness from ANU" quantum)))
|
(symbol :tag "Use Genuine Quantum Randomness from ANU" quantum)))
|
||||||
|
|
||||||
(defcustom i-ching-hexagram-size 18 "Font size of Hexagrams."
|
(defcustom i-ching-hexagram-size 18 "Font size of Hexagrams & Trigrams."
|
||||||
:type 'integer)
|
:type 'integer)
|
||||||
|
|
||||||
(defcustom i-ching-hexagram-font "DejaVu Sans" "Font to use for Hexagrams."
|
(defcustom i-ching-hexagram-font "DejaVu Sans" "Font to use for Hexagrams."
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom i-ching-trigram-font "DejaVu Sans" "Font to use for Trigrams."
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
(defun i-ching-update-fontsize ()
|
(defun i-ching-update-fontsize ()
|
||||||
"Change the font and size of Hexagrams in Unicode range 4DC0—4DFF."
|
"Change the font and size of Hexagrams in Unicode range 4DC0—4DFF."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((hexagram (font-spec :family i-ching-hexagram-font :size i-ching-hexagram-size)))
|
(let ((hexagram (font-spec :family i-ching-hexagram-font :size i-ching-hexagram-size))
|
||||||
(set-fontset-font t '(#x4DC0 . #x4DFF) hexagram)))
|
(trigram (font-spec :family i-ching-trigram-font :size i-ching-hexagram-size)))
|
||||||
|
(set-fontset-font t '(#x4DC0 . #x4DFF) hexagram)
|
||||||
|
(set-fontset-font t '(#x2360 . #x2637) trigram)))
|
||||||
|
|
||||||
;; various sequences of hexagrams
|
;; various sequences of hexagrams
|
||||||
|
|
||||||
(defvar i-ching-sequence-king-wen
|
(defvar i-ching-sequence-king-wen
|
||||||
'((1 . "䷀") (2 . "䷁") (3 . "䷂") (4 . "䷃") (5 . "䷄") (6 . "䷅") (7 . "䷆") (8 . "䷇")
|
'((1 . "䷀") (2 . "䷁") (3 . "䷂") (4 . "䷃")
|
||||||
(9 . "䷈") (10 . "䷉") (11 . "䷊") (12 . "䷋") (13 . "䷌") (14 . "䷍") (15 . "䷎") (16 . "䷏")
|
(5 . "䷄") (6 . "䷅") (7 . "䷆") (8 . "䷇")
|
||||||
(17 . "䷐") (18 . "䷑") (19 . "䷒") (20 . "䷓") (21 . "䷔") (22 . "䷕") (23 . "䷖") (24 . "䷗")
|
(9 . "䷈") (10 . "䷉") (11 . "䷊") (12 . "䷋")
|
||||||
(25 . "䷘") (26 . "䷙") (27 . "䷚") (28 . "䷛") (29 . "䷜") (30 . "䷝") (31 . "䷞") (32 . "䷟")
|
(13 . "䷌") (14 . "䷍") (15 . "䷎") (16 . "䷏")
|
||||||
(33 . "䷠") (34 . "䷡") (35 . "䷢") (36 . "䷣") (37 . "䷤") (38 . "䷥") (39 . "䷦") (40 . "䷧")
|
(17 . "䷐") (18 . "䷑") (19 . "䷒") (20 . "䷓")
|
||||||
(41 . "䷨") (42 . "䷩") (43 . "䷪") (44 . "䷫") (45 . "䷬") (46 . "䷭") (47 . "䷮") (48 . "䷯")
|
(21 . "䷔") (22 . "䷕") (23 . "䷖") (24 . "䷗")
|
||||||
(49 . "䷰") (50 . "䷱") (51 . "䷲") (52 . "䷳") (53 . "䷴") (54 . "䷵") (55 . "䷶") (56 . "䷷")
|
(25 . "䷘") (26 . "䷙") (27 . "䷚") (28 . "䷛")
|
||||||
(57 . "䷸") (58 . "䷹") (59 . "䷺") (60 . "䷻") (61 . "䷼") (62 . "䷽") (63 . "䷾") (64 . "䷿"))
|
(29 . "䷜") (30 . "䷝") (31 . "䷞") (32 . "䷟")
|
||||||
|
(33 . "䷠") (34 . "䷡") (35 . "䷢") (36 . "䷣")
|
||||||
|
(37 . "䷤") (38 . "䷥") (39 . "䷦") (40 . "䷧")
|
||||||
|
(41 . "䷨") (42 . "䷩") (43 . "䷪") (44 . "䷫")
|
||||||
|
(45 . "䷬") (46 . "䷭") (47 . "䷮") (48 . "䷯")
|
||||||
|
(49 . "䷰") (50 . "䷱") (51 . "䷲") (52 . "䷳")
|
||||||
|
(53 . "䷴") (54 . "䷵") (55 . "䷶") (56 . "䷷")
|
||||||
|
(57 . "䷸") (58 . "䷹") (59 . "䷺") (60 . "䷻")
|
||||||
|
(61 . "䷼") (62 . "䷽") (63 . "䷾") (64 . "䷿"))
|
||||||
"The Hexagrams ordered by index in the King Wen sequence.")
|
"The Hexagrams ordered by index in the King Wen sequence.")
|
||||||
|
|
||||||
(defvar i-ching-sequence-leibniz
|
(defvar i-ching-sequence-leibniz
|
||||||
|
@ -134,7 +146,7 @@
|
||||||
;; Hexagram details have been extracted from Wikipedia (CC-BY-SA) and the Unicode Standard.
|
;; Hexagram details have been extracted from Wikipedia (CC-BY-SA) and the Unicode Standard.
|
||||||
;;
|
;;
|
||||||
;; Several variants on the names and descriptions are included, with "The Judgment"
|
;; Several variants on the names and descriptions are included, with "The Judgment"
|
||||||
;; (or "Decision") and "The Image" for each hexagram based on either the unicode name,
|
;; (or "Decision") and "The Image" for each hexagram based on either the Unicode name,
|
||||||
;; Wilhelm or Legge translation. Most of the descriptions have been updated to reflect
|
;; Wilhelm or Legge translation. Most of the descriptions have been updated to reflect
|
||||||
;; current preferences for gender-neutral and imperative mood (mostly) in line with Pearson.
|
;; current preferences for gender-neutral and imperative mood (mostly) in line with Pearson.
|
||||||
;;
|
;;
|
||||||
|
@ -149,7 +161,9 @@
|
||||||
|
|
||||||
(defcustom i-ching-junzi "you should"
|
(defcustom i-ching-junzi "you should"
|
||||||
"The preferred English translation of junzi 君子.
|
"The preferred English translation of junzi 君子.
|
||||||
c.f. ‘The Superior man’ (Legge, Wilhem), ‘Noble young one’ (Hatcher), 'the True Self' (Anthony), 'you should' (Pearson), with reference to “Conventions Used by This Translation” (Pearson)."
|
c.f. `The Superior man’ (Legge, Wilhem), `Noble young one’ (Hatcher),
|
||||||
|
`The True Self' (Anthony), `you should' (Pearson), with reference to
|
||||||
|
`Conventions Used by This Translation' (Pearson)."
|
||||||
:type '(string))
|
:type '(string))
|
||||||
|
|
||||||
(defvar i-ching-hexagram-summary
|
(defvar i-ching-hexagram-summary
|
||||||
|
@ -473,7 +487,7 @@ c.f. ‘The Superior man’ (Legge, Wilhem), ‘Noble young one’ (Hatcher), 't
|
||||||
"BEFORE COMPLETION. Success. But if the young fox, that has nearly crossed the stream, gets his tail wet there will be no advantage."
|
"BEFORE COMPLETION. Success. But if the young fox, that has nearly crossed the stream, gets his tail wet there will be no advantage."
|
||||||
"The image of the condition before transition. Thus, you should carefully discriminate among the qualities of things, so that each can find its place."
|
"The image of the condition before transition. Thus, you should carefully discriminate among the qualities of things, so that each can find its place."
|
||||||
"HEXAGRAM FOR BEFORE COMPLETION"))
|
"HEXAGRAM FOR BEFORE COMPLETION"))
|
||||||
"The Hexagrams. Their name, description, judgment and image. Basis for interpretation.")
|
"The Hexagrams. Their name, description, judgement and image. Basis for interpretation.")
|
||||||
|
|
||||||
|
|
||||||
;;;;;; ;;;;; ; ; ; ; ; ; ; ;
|
;;;;;; ;;;;; ; ; ; ; ; ; ; ;
|
||||||
|
@ -485,12 +499,12 @@ c.f. ‘The Superior man’ (Legge, Wilhem), ‘Noble young one’ (Hatcher), 't
|
||||||
|
|
||||||
|
|
||||||
(defun i-ching-number-to-hexagram (number)
|
(defun i-ching-number-to-hexagram (number)
|
||||||
"Convert a NUMBER from the King Wen sequence to a unicode hexagram."
|
"Convert a NUMBER from the King Wen sequence to a Unicode hexagram."
|
||||||
(let ((hexagrams i-ching-sequence-king-wen))
|
(let ((hexagrams i-ching-sequence-king-wen))
|
||||||
(alist-get number hexagrams)))
|
(alist-get number hexagrams)))
|
||||||
|
|
||||||
(defun i-ching-binary-to-hexagram (number)
|
(defun i-ching-binary-to-hexagram (number)
|
||||||
"Convert a binary NUMBER to a unicode hexagram (in Lower → Upper line order)."
|
"Convert a binary NUMBER to a Unicode hexagram (in Lower → Upper line order)."
|
||||||
(let ((hexagrams i-ching-sequence-leibniz))
|
(let ((hexagrams i-ching-sequence-leibniz))
|
||||||
(alist-get number hexagrams)))
|
(alist-get number hexagrams)))
|
||||||
|
|
||||||
|
@ -526,12 +540,12 @@ c.f. ‘The Superior man’ (Legge, Wilhem), ‘Noble young one’ (Hatcher), 't
|
||||||
(nth 3 (alist-get number hexagrams))))
|
(nth 3 (alist-get number hexagrams))))
|
||||||
|
|
||||||
(defun i-ching-number-to-unicode-name (number)
|
(defun i-ching-number-to-unicode-name (number)
|
||||||
"The unicode name of Hexagram NUMBER."
|
"The Unicode name of Hexagram NUMBER."
|
||||||
(let ((hexagrams i-ching-hexagram-summary))
|
(let ((hexagrams i-ching-hexagram-summary))
|
||||||
(nth 4 (alist-get number hexagrams))))
|
(nth 4 (alist-get number hexagrams))))
|
||||||
|
|
||||||
(defun i-ching-number-to-name (number)
|
(defun i-ching-number-to-name (number)
|
||||||
"The name of Hexagram NUMBER based on it's unicode name."
|
"The name of Hexagram NUMBER based on it's Unicode name."
|
||||||
(let* ((hexagrams i-ching-hexagram-summary)
|
(let* ((hexagrams i-ching-hexagram-summary)
|
||||||
(unicode-name (nth 4 (alist-get number hexagrams))))
|
(unicode-name (nth 4 (alist-get number hexagrams))))
|
||||||
(when unicode-name
|
(when unicode-name
|
||||||
|
@ -539,7 +553,7 @@ c.f. ‘The Superior man’ (Legge, Wilhem), ‘Noble young one’ (Hatcher), 't
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun i-ching-describe-hexagram (point mark)
|
(defun i-ching-describe-hexagram (point mark)
|
||||||
"Show the name of a HEXAGRAM (between POINT and MARK) based on it's unicode name."
|
"Show the name of a HEXAGRAM (between POINT and MARK) based on it's Unicode name."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(if (use-region-p)
|
(if (use-region-p)
|
||||||
(let* ((hexagrams i-ching-hexagram-summary)
|
(let* ((hexagrams i-ching-hexagram-summary)
|
||||||
|
|
Loading…
Reference in a new issue