Given that the variable x
contains the numeric representation of the key "Control-Z", say
(setq x ?\C-z),
one may graphically represent its contents by issuing the command
(char-to-string x),
producing the usual representation of "Control-Z", namely "^Z". I would like to acheive a similar effect in case x
contained the numeric representation of "Meta-Z", namely
(setq x ?\M-z).
However my system represents "Meta-Z" as the number 134217850, and (char-to-string x)
now causes the error (wrong-type-argument characterp 134217850)
. I am aware that the graphical representation of "Meta-Z" is not as standard as
for "Control-Z", since the latter is part of the ASCII code while the former isn't, but anything legible, such as "M-Z" would be better than the big number 134217850.
My question is thus: which standard elisp function should I use in order to transform numerical representations of Meta characters into a legible string?
(key-description [?\M-z])
(but it has to be a vector, not a single number).