added function for org macros

This commit is contained in:
Phuntsok Drak-pa 2019-08-13 16:39:23 +02:00
parent d8a4a5a274
commit 845b6cfd7a
1 changed files with 125 additions and 103 deletions

228
funcs.el
View File

@ -9,111 +9,111 @@
;;
;;; License: GPLv3
(setq conlanging//matter-latin-to-runes '((", *" . "")
(setq conlanging//matter-latin-to-runes '((", *" . "")
("\\. *" . "")
(" +" . "")
("ċ" . "")
("ch" . "")
("ae" . "")
("æ" . "")
("dh" . "")
("z" . "")
("ð" . "")
("th" . "")
("s" . "")
("þ" . "")
("w" . "")
("ƿ" . "")
("g" . "")
("" . "")
("ea" . "")
("f" . "")
("u" . "")
("o" . "")
("r" . "")
("c" . "")
("h" . "")
("n" . "")
("i" . "")
("j" . "")
("p" . "")
("v" . "")
("t" . "")
("b" . "")
("e" . "")
("m" . "")
("l" . "")
("d" . "")
("é" . "")
("a" . "")
("y" . "")))
(" +" . "")
("ċ" . "")
("ch" . "")
("ae" . "")
("æ" . "")
("dh" . "")
("z" . "")
("ð" . "")
("th" . "")
("s" . "")
("þ" . "")
("w" . "")
("ƿ" . "")
("g" . "")
("" . "")
("ea" . "")
("f" . "")
("u" . "")
("o" . "")
("r" . "")
("c" . "")
("h" . "")
("n" . "")
("i" . "")
("j" . "")
("p" . "")
("v" . "")
("t" . "")
("b" . "")
("e" . "")
("m" . "")
("l" . "")
("d" . "")
("é" . "")
("a" . "")
("y" . "")))
(setq conlanging//matter-latin-to-native '((" +" . " ")
("ch" . "ċ")
("ae" . "æ")
("th" . "þ")
("s" . "þ")
("s" . "þ")
("dh" . "ð")
("z" . "ð")
("w" . "ƿ")
("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")))
("z" . "ð")
("w" . "ƿ")
("j" . "i")))
(setq conlanging//matter-latin-to-latex '((", *" . ":")
("\\. *" . "*")
(" +" . ".")
("ch" . "I")
("ċ" . "I")
("ae" . "æ")
("ea" . "\\\\ea")
("ƿ" . "w")
("dh" . "s")
("z" . "s")
("ð" . "s")
("th" . "þ")
("s" . "þ")
("v" . "\\\\ng")
("é " . "\\\\oe")))
(setq conlanging//einnlanda-latin-to-latex '((", *" . "\\\\tripledot")
(setq conlanging//einnlanda-latin-to-latex '((", *" . "\\\\tripledot")
("\\. *" . "\\\\tripledot")
(" +" . ":")
("hw" . "x")
("ø" . "\\\\o")
("ö" . "\\\\oO")
("ó" . "v")
("ń" . "\\\\ndot")
("v" . "b")))
(setq conlanging//einnlanda-latin-to-runes '((", *" . "")
(" +" . ":")
("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" . "")))
(" +" . "")
("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)
"Return a copy of t-string converted with the correspondance
@ -159,30 +159,52 @@ with."
; Mattér ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun conlanging/matter-to-runes ()
"Replaces transliterated Mattér to its runic writing system"
"Replaces transliterated Mattér with its runic writing system"
(interactive)
(conlanging//replace-char-by-table conlanging//matter-latin-to-runes))
(defun conlanging/matter-to-native-latin ()
"Replaces transliterated Mattér by its corresponding native
"Replaces transliterated Mattér with its corresponding native
latin writing system"
(interactive)
(conlanging//replace-char-by-table conlanging//matter-latin-to-native))
(defun conlanging/matter-to-latex ()
"Replaces transliterated Mattér by its corresponding runes"
"Replaces transliterated Mattér with its corresponding runes"
(interactive)
(conlanging//replace-char-by-table conlanging//matter-latin-to-latex-runes))
(conlanging//replace-char-by-table conlanging//matter-latin-to-latex))
(defun conlanging/matter-org-export-runes (text)
"Replaces transliterated Mattér with its corresponding runes during org-mode
export"
(interactive)
(if (org-export-derived-backend-p org-export-current-backend
'latex)
(concat "\\textarm{"
(conlanging//replace-string-by-char text conlanging//matter-latin-to-latex)
"}")
(conlanging//replace-string-by-char text conlanging//matter-latin-to-runes)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Einnlanda ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun conlanging/einnlanda-to-runes ()
"Replaces transliterated Mattér to its runic writing system"
"Replaces transliterated Einnlandic with 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"
"Replaces transliterated Einnlandic with its corresponding runes"
(interactive)
(conlanging//replace-char-by-table conlanging//einnlanda-latin-to-latex-runes))
(conlanging//replace-char-by-table conlanging//einnlanda-latin-to-latex))
(defun conlanging/einnlanda-org-export-runes (text)
"Replaces transliterated Einnlandic with its corresponding runes during
org-mode export"
(interactive)
(if (org-export-derived-backend-p org-export-current-backend
'latex)
(concat "\\textarm{"
(conlanging//replace-string-by-char text conlanging//einnlanda-latin-to-latex)
"}")
(conlanging//replace-string-by-char text conlanging//einnlanda-latin-to-runes)))