My MacBook has two enter keys.
I have recently started using Emacs24. I have noticed, whenever I am in viper-mode and I issue any command, for example
M-x toggle-viper-mode
Return key does not work. Instead I get an error.
Wrong type argument: characterp, return
I have to use fn+return or Ctrl+m or the enter.
If I disable viper-mode return works without any error.
I tried using a solution from Gnu Emacs mailing list archive but it didn't work.
(define-key function-key-map [return] [?\C-m])
How can I fix it so that return key works with commands in viper-mode too?
Update
The result of C-h k for return key when viper-mode is not loaded.
<return> runs the command autopair-newline, which is an interactive Lisp function in `autopair.el'.
It is bound to RET, <return>.
The result of C-h k for enter key when viper-mode is not loaded.
RET (translated from <kp-enter>) runs the command autopair-newline, which is an interactive Lisp function in `autopair.el'.
It is bound to RET, <return>
The result of C-h k for return key when viper-mode is loaded.
<return> runs the command autopair-newline, which is an interactive Lisp function in `autopair.el'.
It is bound to RET, <return>.
The result of C-h k for enter key when viper-mode is loaded.
RET (translated from <kp-enter>) runs the command autopair-newline, which is an interactive Lisp function in `autopair.el'.
It is bound to RET, <return>.
The problem is return key does not work in minibuffer when viper-mode is loaded, although the mappings are similar as you can see above.
So it appears that autopair-newline
is not working correctly in viper-mode. The source for that function indicates is has some special handling of the "RET" keyboard binding.