When using the command translate-region
, the command asks to use which table. There are already some predefined tables (by pressing TAB) such as
cp51932-decode cp51932-encode eucjp-ms-decode eucjp-ms-encode japanese-ucs-cp932-to-jis-map japanese-ucs-glibc-to-jis-map japanese-ucs-jis-to-cp932-map japanese-ucs-jis-to-glibc-map jisx0213-to-unicode ucs-normalize-hfs-nfd-table ucs-normalize-nfd-table ucs-normalize-nfkd-table unicode-to-jisx0213
What if someone likes to create its own table?
For example, assume that one would like to create a conversion table like below:
1 --> 2
a --> x
n --> m
8 --> 0
σ --> s
What I have tried: based on one of the above tables, I defined a table as bellow, but I get the error apply: Wrong type argument: integerp, x
(let ((map
'(
(1 . 2)
(a . x)
(n . m)
(8 . 0)
(σ . s)
)))
(define-translation-table 'my-conversion-decode map)
(mapc #'(lambda (x)
(let ((tmp (car x)))
(setcar x (cdr x)) (setcdr x tmp)))
map)
(define-translation-table 'my-conversion-encode map))