+ (cond ;; If meta-flag is t we get a meta character
+ ((>= c ?\M-\^@)
+ (- c (- ?\M-\^@ 128)))
+ ;; Reencode the character in the keyboard coding system, if
+ ;; this is a non-ASCII character.
+ ((>= c #x80)
+ (aref (encode-coding-string (string c) (keyboard-coding-system)) 0))
+ (t c))))