cherlobyle · 2022-05-22 07:41
I found it somehow the RET key is bound to next-line instead of newline.
https://preview.redd.it/85cho0daez091.png?width=1610&format=png&auto=webp&s=bef155034ee0e3e34f602e31e739fa99e17c257b
If I add `;;(global-set-key (kbd "<return>") 'newline)` in init.el then RET can't use as Enter key.
How should I make RET be newline and Enter key at the same time?
L-Szos · 2022-05-22 09:51
If you start emacs as `emacs -Q`, what is `RET` bound to?
cherlobyle · 2022-05-22 10:59
Here is the output of describe key.
`RET (translated from <return>) runs the command newline (found in`
`global-map), which is an interactive compiled Lisp function in`
`‘simple.el’.`
`It is bound to RET.`
`(newline &optional ARG INTERACTIVE)`
L-Szos · 2022-05-22 12:57
Something in your config is binding `RET` then, id recommend going through and finding the culprit. Is this occuring in all modes or just some specific ones? If its just some specific ones you can narrow down where the rebinding is occurring.
cherlobyle · 2022-05-22 17:41
I think it is bound in all modes 😢 Thanks!
dpoggio · 2022-05-22 22:34
You can `(trace-function 'define-key)` from init.el, use normally, then `M-x untrace-all`. Go to `*trace-output*` and search with `[[:space:]]RET` to find the problem.
dpoggio · 2022-05-23 18:27
Try and trace it: Put `(trace-function 'define-key)` on top of your init.el, open Emacs, then `M-x untrace-all` to stop tracing. There should be a buffer `*trace-output*`. Go there and search with the regexp `[[:space:]]RET` to find the problem. Other good search would be `next-line`. If you use highlighting, highlighting both would be helpful. There’s a lot of traces, but be patient and you’ll find the crappy bits.
cherlobyle · 2022-05-24 00:59
Thanks!