Emacs: Latin to Rune (ᚱᚢᚿᛂ) 📜

By Xah Lee. Date: . Last updated: .

Here's a command that convert Latin alphabet characters to Unicode Runic characters.

ᚼᛂᚱᛂ'ᛌ ᛆ ᛍᚮᛘᛘᛆᚿᛑ ᛐᚼᛆᛐ ᛍᚮᚿᚡᛂᚱᛐ ᛚᛆᛐᛁᚿ ᛆᛚᛔᚼᛆᛒᛂᛐ ᛍᚼᛆᚱᛆᛍᛐᛂᚱᛌ ᛐᚮ ᚢᚿᛁᛍᚮᛑᛂ ᚱᚢᚿᛁᛍ ᛍᚼᛆᚱᛆᛍᛐᛂᚱᛌ.

put this in your Emacs Init File:

(defun xah-convert-latin-to-rune (Begin End ToLatinQ)
 "Replace english alphabet to runic characters.
For example, f → ᚠ.
When called interactively, work on current line or text selection.
If `universal-argument' is called first, reverse direction.
Note: original letter case are not preserved. B may become b.
URL `http://xahlee.info/emacs/misc/elisp_latin_to_rune.html'
Created: 2019年06月07日
Version: 2023年05月12日"
 (interactive
 (if (region-active-p)
 (list (region-beginning) (region-end) current-prefix-arg)
 (list (line-beginning-position) (line-end-position) current-prefix-arg)))
 (let (xtoLower xtoLatin xtoRune xuseMap)
 ;; this, because we no want to change case of other lang's chars
 (setq xtoLower [["A" "a"] ["B" "b"] ["C" "c"] ["D" "d"] ["E" "e"] ["F" "f"] ["G" "g"] ["H" "h"] ["I" "i"] ["J" "j"] ["K" "k"] ["L" "l"] ["M" "m"] ["N" "n"] ["O" "o"] ["P" "p"] ["Q" "q"] ["R" "r"] ["S" "s"] ["T" "t"] ["U" "u"] ["V" "v"] ["W" "w"] ["X" "x"] ["Y" "y"] ["Z" "z"] ] )
 (setq xtoLatin [ ["ᛆ" "a"] ["ᛒ" "b"] ["ᛍ" "c"] ["ᛑ" "d"] ["ᚧ" "ð"] ["ᛂ" "e"] ["ᚠ" "f"] ["ᚵ" "g"] ["ᚼ" "h"] ["ᛁ" "i"] ["ᚴ" "k"] ["ᛚ" "l"] ["ᛘ" "m"] ["ᚿ" "n"] ["ᚮ" "o"] ["ᛔ" "p"] ["ᛕ" "p"] ["ᛩ" "q"] ["ᚱ" "r"] ["ᛌ" "s"] ["ᛋ" "s"] ["ᛐ" "t"] ["ᚢ" "u"] ["ᚡ" "v"] ["ᚢ" "v"] ["ᚥ" "w"] ["ᛪ" "x"] ["ᛦ" "y"] ["ᚤ" "y"] ["ᛨ" "y"] ["ᛎ" "z"] ["ᚦ" "þ"] ["ᛅ" "æ"] ["ᛆ" "ä"] ["ᚯ" "ø"] ["ᚯ" "ö"] ])
 (setq xtoRune (mapcar (lambda (xx) (vector (aref xx 1) (aref xx 0))) xtoLatin))
 (setq xuseMap (if ToLatinQ xtoLatin xtoRune))
 (save-excursion
 (save-restriction
 (narrow-to-region Begin End)
 (when (not ToLatinQ)
 ;; change to lower case, but only for English letters, not for example greek etc.
 (mapc
 (lambda (xx)
 (goto-char (point-min))
 (while (search-forward (elt xx 0) nil t)
 (replace-match (elt xx 1) t t)))
 xtoLower))
 (let ((case-fold-search nil))
 (mapc
 (lambda (xx)
 (goto-char (point-min))
 (while (search-forward (elt xx 0) nil t)
 (replace-match (elt xx 1) t t)))
 xuseMap))))))

AltStyle によって変換されたページ (->オリジナル) /