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 → ᚠ.
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-05-25"
  (interactive
   (if (use-region-p)
       (list (region-beginning) (region-end) current-prefix-arg )
     (list (line-beginning-position) (line-end-position) current-prefix-arg )))
  (let* (
         ($toLower
          [["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"]
           ]
          )
         ($toLatin
          [ ["ᛆ" "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"]
            ["ᚦ" "þ"]
            ["ᛅ" "æ"]
            ["ᛆ" "ä"]
            ["ᚯ" "ø"]
            ["ᚯ" "ö"]
            ]
          )
         ($toRunic
          (mapcar
           (lambda ($x)
             (vector (aref $x 1) (aref $x 0)))
           $toLatin))
         ($useMap (if @to-latin-p
                      $toLatin
                    $toRunic)))
    (save-excursion
      (save-restriction
        (narrow-to-region @begin @end)
        (when (not @to-latin-p)
          ;; change to lower case, but only for English letters, not for example greek etc.
          (mapc
           (lambda ($x)
             (goto-char (point-min))
             (while (search-forward (elt $x 0) nil t)
               (replace-match (elt $x 1) "FIXEDCASE" "LITERAL")))
           $toLower))
        (let ( (case-fold-search nil))
          (mapc
           (lambda ($x)
             (goto-char (point-min))
             (while (search-forward (elt $x 0) nil t)
               (replace-match (elt $x 1) "FIXEDCASE" "LITERAL")))
           $useMap))))))

For JavaScript version, see 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

Emacs Lisp

Misc