Emacs: Latin to Rune (ᚱᚢᚾᛖ)

By Xah Lee. Date: . Last updated: .

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

ᚺᛖᚱᛖ'ᛊ ᚨ ᛍᛟᛗᛗᚨᚾᛞ ᛏᚺᚨᛏ ᛍᛟᚾᚡᛖᚱᛏ ᛚᚨᛏᛁᚾ ᚨᛚᛈᚺᚨᛒᛖᛏ ᛍᚺᚨᚱᚨᛍᛏᛖᚱᛊ ᛏᛟ ᚢᚾᛁᛍᛟᛞᛖ ᚱᚢᚾᛁᛍ ᛍᚺᚨᚱᚨᛍᛏᛖᚱᛊ.

(defun xah-convert-latin-to-rune (@begin @end @to-latin-p)
  "Replace English alphabet to Unicode runic characters.
For example, f → ᚠ, d → ᛞ.
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://ergoemacs.org/misc/elisp_latin_to_rune.html'
Version 2019-03-08"
   (if (use-region-p)
       (list (region-beginning) (region-end) current-prefix-arg )
     (list (line-beginning-position) (line-end-position) current-prefix-arg )))
  (let* (
          [["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"]
           ["ᚠ" "f"]
           ["ᚢ" "u"]
           ["ᚦ" "þ"]
           ["ᚨ" "a"]
           ["ᚱ" "r"]
           ["ᚲ" "k"]
           ["ᚷ" "g"]
           ["ᚹ" "w"]
           ["ᚺ" "h"]
           ["ᚾ" "n"]
           ["ᛁ" "i"]
           ["ᛃ" "j"]
           ["ᛈ" "p"]
           ["ᛇ" "ï"]
           ["ᛉ" "z"]
           ["ᛊ" "s"]
           ["ᛏ" "t"]
           ["ᛒ" "b"]
           ["ᛖ" "e"]
           ["ᛗ" "m"]
           ["ᛚ" "l"]
           ["ᛜ" "ŋ"]
           ["ᛞ" "d"]
           ["ᛟ" "o"]
           ["ᛍ" "c"]
           ["ᛩ" "q"]
           ["ᛪ" "x"]
           ["ᚤ" "y"]
           ["ᚡ" "v"]
           (lambda ($x)
             (vector (aref $x 1) (aref $x 0)))
         ($useMap (if @to-latin-p
        (narrow-to-region @begin @end)
        (when (not @to-latin-p)
          ;; change to lower case, but only for English letters, not for example greek etc.
           (lambda ($x)
             (goto-char (point-min))
             (while (search-forward (elt $x 0) nil t)
               (replace-match (elt $x 1) "FIXEDCASE" "LITERAL")))
        (let ( (case-fold-search nil))
           (lambda ($x)
             (goto-char (point-min))
             (while (search-forward (elt $x 0) nil t)
               (replace-match (elt $x 1) "FIXEDCASE" "LITERAL")))

See also: Unicode Rune ᛗ

See also: Emacs: Latin to Gothic (𝔤𝔬𝔱𝔥𝔦𝔠)

xah talk show, 2019-03-07. emacs lisp, write a command to convert English to Runic

If you have a question, put $5 at patreon and message me.
Or Buy Xah Emacs Tutorial
Or buy a nice keyboard: Best Keyboards for Emacs


Emacs Lisp