I want to create a new key binding that puts out a single letter with a key combination. For example: M-E
inserts an "ê" character. Is this possible?
1 Answer
Try this:
(global-set-key (kbd "M-e") '(lambda () (interactive) (insert-char 234)))
How to get 234? Place your cursor on the letter ê
and press C-x =
. Modeline will show you the codes:
Char: ê (234, #o352, #xea, file ...) point=3 of 27 (7%) column=0
-
2
insert-char
to insert that character.C-x 8 ^ e
insertsê
. Similarly usingA
,E
,I
,O
,U
,a
,i
,o
,u
afterC-x 8 ^
would work as you would guess.M-x
is already bound to a command so it can't be a prefix for a keybinding (as the error msg says).