renamed variables, added Einnlandic functions

This commit is contained in:
Phuntsok Drak-pa 2019-08-13 01:52:51 +02:00
parent 5c90eead58
commit d8a4a5a274
2 changed files with 131 additions and 54 deletions

180
funcs.el
View File

@ -9,62 +9,120 @@
;; ;;
;;; License: GPLv3 ;;; License: GPLv3
(setq latin-to-runes-table '((", *" . "") (setq conlanging//matter-latin-to-runes '((", *" . "")
("\\. *" . "") ("\\. *" . "")
(" +" . "") (" +" . "")
("ċ" . "") ("ch" . "") ("ċ" . "")
("ae" . "") ("æ" . "") ("ch" . "")
("dh" . "") ("z" . "") ("ð" . "") ("ae" . "")
("th" . "") ("s" . "") ("þ" . "") ("æ" . "")
("w" . "") ("ƿ" . "") ("dh" . "")
("g" . "") ("" . "") ("z" . "")
("ea" . "") ("ð" . "")
("f" . "") ("th" . "")
("u" . "") ("s" . "")
("o" . "") ("þ" . "")
("r" . "") ("w" . "")
("c" . "") ("ƿ" . "")
("h" . "") ("g" . "")
("n" . "") ("" . "")
("i" . "") ("ea" . "")
("j" . "") ("f" . "")
("p" . "") ("u" . "")
("v" . "") ("o" . "")
("t" . "") ("r" . "")
("b" . "") ("c" . "")
("e" . "") ("h" . "")
("m" . "") ("n" . "")
("l" . "") ("i" . "")
("d" . "") ("j" . "")
("é" . "") ("p" . "")
("a" . "") ("v" . "")
("y" . ""))) ("t" . "")
(setq latin-to-native-table '((" +" . " ") ("b" . "")
("ch" . "ċ") ("e" . "")
("ae" . "æ") ("m" . "")
("th" . "þ") ("s" . "þ") ("l" . "")
("dh" . "ð") ("z" . "ð") ("d" . "")
("w" . "ƿ") ("é" . "")
("j" . "i"))) ("a" . "")
(setq latin-to-latex-runes '((", *" . ":") ("y" . "")))
("\\. *" . "*") (setq conlanging//matter-latin-to-native '((" +" . " ")
(" +" . ".") ("ch" . "ċ")
("ch" . "I") ("ċ" . "I") ("ae" . "æ")
("ae" . "æ") ("th" . "þ")
("ea" . "\\\\ea") ("ƿ" . "w") ("s" . "þ")
("dh" . "s") ("z" . "s") ("ð" . "s") ("dh" . "ð")
("th" . "þ") ("s" . "þ") ("z" . "ð")
("v" . "\\\\ng") ("w" . "ƿ")
("é " . "\\\\oe"))) ("j" . "i")))
(setq conlanging//matter-latin-to-latex-runes '((", *" . ":")
("\\. *" . "*")
(" +" . ".")
("ch" . "I")
("ċ" . "I")
("ae" . "æ")
("ea" . "\\\\ea")
("ƿ" . "w")
("dh" . "s")
("z" . "s")
("ð" . "s")
("th" . "þ")
("s" . "þ")
("v" . "\\\\ng")
("é " . "\\\\oe")))
(setq conlanging//einnlanda-latin-to-latex '((", *" . "\\\\tripledot")
("\\. *" . "\\\\tripledot")
(" +" . ":")
("hw" . "x")
("ø" . "\\\\o")
("ö" . "\\\\oO")
("ó" . "v")
("ń" . "\\\\ndot")
("v" . "b")))
(setq conlanging//einnlanda-latin-to-runes '((", *" . "")
("\\. *" . "")
(" +" . "")
("hw" . "")
("i" . "")
("j" . "")
("y" . "")
("u" . "")
("e" . "")
("ø" . "")
("o" . "")
("ö" . "")
("ó" . "")
("æ" . "")
("a" . "")
("m" . "")
("n" . "")
("ń" . "")
("p" . "")
("b" . "")
("t" . "")
("d" . "")
("k" . "")
("g" . "")
("f" . "")
("v" . "")
("þ" . "")
("ð" . "")
("s" . "")
("h" . "")
("w" . "")
("r" . "")
("l" . "")))
(defun conlanging//replace-string-by-char (t-string t-correspondance-table) (defun conlanging//replace-string-by-char (t-string t-correspondance-table)
"Return a copy of t-string converted with the correspondance "Return a copy of t-string converted with the correspondance
table" table"
(interactive)
(while t-correspondance-table (while t-correspondance-table
(let ((cur-from-char (car (car t-correspondance-table))) (let ((cur-from-char (car (car t-correspondance-table)))
(cur-to-char (cdr (car t-correspondance-table)))) (cur-to-char (cdr (car t-correspondance-table))))
(setq t-string (replace-regexp-in-string cur-from-char (setq t-string (replace-regexp-in-string cur-from-char cur-to-char
cur-to-char
t-string)) t-string))
(setq t-correspondance-table (cdr t-correspondance-table)))) (setq t-correspondance-table (cdr t-correspondance-table))))
t-string) t-string)
@ -97,18 +155,34 @@ with."
(insert regionp))) (insert regionp)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Mattér ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun conlanging/matter-to-runes () (defun conlanging/matter-to-runes ()
"Replaces transliterated Mattér to its runic writing system" "Replaces transliterated Mattér to its runic writing system"
(interactive) (interactive)
(conlanging//replace-char-by-table latin-to-runes-table)) (conlanging//replace-char-by-table conlanging//matter-latin-to-runes))
(defun conlanging/matter-to-native-latin () (defun conlanging/matter-to-native-latin ()
"Replaces transliterated Mattér by its corresponding native "Replaces transliterated Mattér by its corresponding native
latin writing system" latin writing system"
(interactive) (interactive)
(conlanging//replace-char-by-table latin-to-native-table)) (conlanging//replace-char-by-table conlanging//matter-latin-to-native))
(defun conlanging/matter-to-latex-runes () (defun conlanging/matter-to-latex ()
"Replaces transliterated Mattér by its corresponding runes" "Replaces transliterated Mattér by its corresponding runes"
(interactive) (interactive)
(conlanging//replace-char-by-table latin-to-latex-runes)) (conlanging//replace-char-by-table conlanging//matter-latin-to-latex-runes))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Einnlanda ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun conlanging/einnlanda-to-runes ()
"Replaces transliterated Mattér to its runic writing system"
(interactive)
(conlanging//replace-char-by-table conlanging//einnlanda-latin-to-runes))
(defun conlanging/einnlanda-to-latex ()
"Replaces transliterated Mattér by its corresponding runes"
(interactive)
(conlanging//replace-char-by-table conlanging//einnlanda-latin-to-latex-runes))

View File

@ -21,6 +21,7 @@
(spacemacs/declare-prefix "olt" "Tãso") (spacemacs/declare-prefix "olt" "Tãso")
(spacemacs/declare-prefix "olto" "taso.org") (spacemacs/declare-prefix "olto" "taso.org")
(spacemacs/declare-prefix-for-mode 'org-mode "ml" "conlanging") (spacemacs/declare-prefix-for-mode 'org-mode "ml" "conlanging")
(spacemacs/declare-prefix-for-mode 'org-mode "mle" "Einnlanda")
(spacemacs/declare-prefix-for-mode 'org-mode "mlm" "Mattér") (spacemacs/declare-prefix-for-mode 'org-mode "mlm" "Mattér")
(spacemacs/set-leader-keys (spacemacs/set-leader-keys
@ -38,6 +39,8 @@
(spacemacs/set-leader-keys-for-major-mode 'org-mode (spacemacs/set-leader-keys-for-major-mode 'org-mode
"lmr" 'conlanging/matter-to-runes "lmr" 'conlanging/matter-to-runes
"lml" 'conlanging/matter-to-native-latin "lml" 'conlanging/matter-to-native-latin
"lmL" 'conlanging/matter-to-latex-runes) "lmL" 'conlanging/matter-to-latex
"ler" 'conlanging/einnlanda-to-runes
"lel" 'conlanging/einnlanda-to-latex)
;;; keybindings.el ends here ;;; keybindings.el ends here