Emacs: Replace Greek Letter Names to Unicode

By Xah Lee. Date: .
emacs greek to symbol

Here's a command to convert Greek to unicode symbols.

(require 'xah-replace-pairs)

(defun xah-replace-greek-letter-name-to-symbol (@begin @end)
  "Replace alpha to α, beta to β etc in current line or selection.

URL `http://ergoemacs.org/emacs/elisp_replace_greeks_to_symbols.html'
Version 2016-10-05"
  (interactive
   (if (use-region-p)
       (list (region-beginning) (region-end))
     (list (line-beginning-position) (line-end-position))))
  (let ((case-fold-search nil))
    (xah-replace-pairs-region
     @begin
     @end
     '(
       ["Alpha" "Α"]
       ["Beta" "Β"]
       ["Gamma" "Γ"]
       ["Delta" "Δ"]
       ["Epsilon" "Ε"]
       ["Zeta" "Ζ"]
       ["Eta" "Η"]
       ["Theta" "Θ"]
       ["Iota" "Ι"]
       ["Kappa" "Κ"]
       ["Lambda" "Λ"]
       ["Mu" "Μ"]
       ["Nu" "Ν"]
       ["Xi" "Ξ"]
       ["Omicron" "Ο"]
       ["Pi" "Π"]
       ["Rho" "Ρ"]
       ["Sigma" "Σ"]
       ["Tau" "Τ"]
       ["Upsilon" "Υ"]
       ["Phi" "Φ"]
       ["Chi" "Χ"]
       ["Psi" "Ψ"]
       ["Omega" "Ω"]

       ["alpha" "α"]
       ["beta" "β"]
       ["gamma" "γ"]
       ["delta" "δ"]
       ["epsilon" "ε"]
       ["zeta" "ζ"]
       ["eta" "η"]
       ["theta" "θ"]
       ["iota" "ι"]
       ["kappa" "κ"]
       ["lambda" "λ"]
       ["mu" "μ"]
       ["nu" "ν"]
       ["xi" "ξ"]
       ["omicron" "ο"]
       ["pi" "π"]
       ["rho" "ρ"]
       ["sigmaf" "ς"]
       ["sigma" "σ"]
       ["tau" "τ"]
       ["upsilon" "υ"]
       ["phi" "φ"]
       ["chi" "χ"]
       ["psi" "ψ"]
       ["omega" "ω"]
       ["thetasym" "ϑ"]
       ["upsih" "ϒ"]
       ["piv" "ϖ"]
       ) 'REPORT 'HILIGHT )))

You need the elisp library Emacs: xah-replace-pairs.el Multi-Pair Find Replace.

Emacs Text Transform Under Cursor

  1. elisp wrapper + Python Ruby …
  2. Toggle Letter Case
  3. Title Case
  4. Upcase Sentences
  5. Cycle Space Hyphen Underscore
  6. Escape Quotes
  7. Quote Lines
  8. Spaces to New Lines
  9. Change Brackets/Quotes
  10. Remove Accent Marks
  11. Convert Straight/Curly Quotes
  12. Convert English/Chinese Punctuations
  13. Color Conversion (RGB, HSL, HSV)
  14. Decimal to Hexadecimal
  15. Replace Greek Letter Names to Unicode
  16. Twitterfy Text
  17. Toggle line wrap
  18. Clean White Space

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