Skip to content

Instantly share code, notes, and snippets.

@quite
Created September 30, 2011 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quite/1253614 to your computer and use it in GitHub Desktop.
Save quite/1253614 to your computer and use it in GitHub Desktop.
Transliteration of Georgian language script, for emacs
;;; mkhedruli-util.el --- utilities for Mkhedruli scripts (Georgian language)
;; A modified cyril-util.el (by Valery Alexeev)
;; GPLv3
;; Display
(defvar mkhedruli-language-alist
(list '("Georgian"))
"List of known Mkhedruli languages.")
(defvar mkhedruli-active nil
"Is mkhedruli transliteration currently active?")
(make-variable-buffer-local 'mkhedruli-active)
;;;###autoload
(defun standard-display-mkhedruli-translit ()
"Display a mkhedruli (Georgian) buffer using a transliteration."
(interactive)
(or buffer-display-table
(setq buffer-display-table (make-display-table)))
(let ( (mkhedruli-language nil) )
(if (equal mkhedruli-active nil)
(setq mkhedruli-language "Georgian")
(setq mkhedruli-language nil))
(with-current-buffer (current-buffer)
(if (equal mkhedruli-language nil)
(setq mkhedruli-active nil)
(setq mkhedruli-active t)))
(if (null mkhedruli-language)
(setq buffer-display-table (make-display-table))
(aset buffer-display-table ?ა [?a]) ;a
(aset buffer-display-table ?ბ [?b]) ;b
(aset buffer-display-table ?გ [?g]) ;g
(aset buffer-display-table ?დ [?d]) ;d
(aset buffer-display-table ?ე [?e]) ;e
(aset buffer-display-table ?ვ [?v]) ;v
(aset buffer-display-table ?ზ [?z]) ;z
(aset buffer-display-table ?თ [?t]) ;T
(aset buffer-display-table ?ი [?i]) ;i
(aset buffer-display-table ?კ [?k ?']) ;k
(aset buffer-display-table ?ლ [?l]) ;l
(aset buffer-display-table ?მ [?m]) ;m
(aset buffer-display-table ?ნ [?n]) ;n
(aset buffer-display-table ?ო [?o]) ;o
(aset buffer-display-table ?პ [?p ?']) ;p
(aset buffer-display-table ?ჟ [?z ?h]) ;J
(aset buffer-display-table ?რ [?r]) ;r
(aset buffer-display-table ?ს [?s]) ;s
(aset buffer-display-table ?ტ [?t ?']) ;t
(aset buffer-display-table ?უ [?u]) ;u
(aset buffer-display-table ?ფ [?p]) ;f
(aset buffer-display-table ?ქ [?k]) ;q
(aset buffer-display-table ?ღ [?g ?h]) ;R
(aset buffer-display-table ?ყ [?q ?']) ;y
(aset buffer-display-table ?შ [?s ?h]) ;S
(aset buffer-display-table ?ჩ [?c ?h]) ;C
(aset buffer-display-table ?ც [?c]) ;c
(aset buffer-display-table ?ძ [?d ?z]) ;Z
(aset buffer-display-table ?წ [?c ?']) ;w
(aset buffer-display-table ?ჭ [?c ?h ?']) ;W
(aset buffer-display-table ?ხ [?x]) ;x
(aset buffer-display-table ?ჯ [?d ?z ?h]) ;j
(aset buffer-display-table ?ჰ [?h]) ;h
; disable line-wrapping end-of-line character (\)
(set-display-table-slot buffer-display-table 'wrap ?\ )
(set-display-table-slot buffer-display-table 'vertical-border ?│)
))
(redraw-display))
;; Local Variables:
;; coding: utf-8
;; End:
;;
(provide 'mkhedruli-util)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment