Download
(defvar translation-table-subtype 'translation-table)
(defun remap-translation-table (char-table mapper-char-table)
(let ((mapped (make-char-table translation-table-subtype)))
(set-char-table-parent mapped char-table)
(map-char-table (lambda (key value)
(let ((translation (aref char-table key)))
(when translation
(aset mapped key nil)
(aset mapped value translation))))
mapper-char-table)
mapped))
(defmacro define-translation-table (name &rest definition)
(declare (indent defun))
`(progn
(defvar ,name (make-char-table translation-table-subtype))
,@(mapcar (lambda (pair)
(list 'aset name (car pair) (cdr pair)))
definition)))
(define-translation-table translation-table-dvorak-us
(?- . ?\[)
(?_ . ?\{)
(?= . ?\])
(?+ . ?\})
(?q . ?')
(?Q . ?\")
(?w . ?,)
(?W . ?<)
(?e . ?.)
(?E . ?>)
(?r . ?p)
(?R . ?P)
(?t . ?y)
(?T . ?Y)
(?y . ?f)
(?Y . ?F)
(?u . ?g)
(?U . ?G)
(?i . ?c)
(?I . ?C)
(?o . ?r)
(?O . ?R)
(?p . ?l)
(?P . ?L)
(?\[ . ?/)
(?\{ . ??)
(?\] . ?=)
(?\} . ?+)
(?a . ?a)
(?A . ?A)
(?s . ?o)
(?S . ?O)
(?d . ?e)
(?D . ?E)
(?f . ?u)
(?F . ?U)
(?g . ?i)
(?G . ?I)
(?h . ?d)
(?H . ?D)
(?j . ?h)
(?J . ?H)
(?k . ?t)
(?K . ?T)
(?l . ?n)
(?L . ?N)
(?\; . ?s)
(?\: . ?S)
(?\' . ?-)
(?\" . ?_)
(?z . ?\;)
(?Z . ?\:)
(?x . ?q)
(?X . ?Q)
(?c . ?j)
(?C . ?J)
(?v . ?k)
(?V . ?K)
(?b . ?x)
(?B . ?X)
(?n . ?b)
(?N . ?B)
(?m . ?m)
(?M . ?M)
(?, . ?w)
(?< . ?W)
(?. . ?v)
(?> . ?V)
(?/ . ?z)
(?? . ?Z))
(provide 'trantab)
;;; trantab.el ends here