2

I'm trying to open a file with a given encoding and running into the problem that C-m is the same as RET. There is an answer here. However, I don't want to bind a specific function; I want to restore all C-x C-m key bindings to their intended behavior; so, the next time I look up how to do something, it just works.

This raises the question of why there even are C-x C-m bindings if they don't work. Note I'm assuming this documentation is correct. I don't know how to look up the command for the binding. If I use C-h k to describe the command, I'm still stuck with the problem of how to type C-x C-m!

I also looked at this answer, but I'm not clear if he's saying it can't be done, or is it only in a terminal that it's a problem? I'm only using emacs in a GUI; I can't remember the last time I used it in a terminal. I'm open to workarounds, such as using a different key. The trouble with this is I won't remember it has been remapped unless I use it frequently...

  • Documentation usually uses C-m and RET interchangably. And usually they are interchangable. Are you asking how to undo the effect of (define-key input-decode-map [?\C-m] [C-m])? – npostavs Jan 29 '17 at 16:29
  • No, you just answered my question. I didn't understand they are effectively the same thing. I don't need to do anything except not look at the command in the minibufffer. – Todd Jan 29 '17 at 17:00
3

Note I'm assuming this documentation is correct.

It's basically correct, it sometimes puts C-m instead of RET. In a default configured Emacs those are the same anyway and you might find it easier to type C-x C-m than C-x <return>. Note that the official documentation uses RET uniformly in this case, (emacs) Text Coding:

C-x RET f coding RET
Use coding system coding to save or revisit the file in the current buffer (set-buffer-file-coding-system).


I also looked at this answer, but I'm not clear if he's saying it can't be done, or is it only in a terminal that it's a problem?

That's explaining that in a terminal, it's not possible to have C-m and RET be different. You can make them different in a GUI Emacs, but you probably shouldn't.

  • +1 for referencing the doc and for "but you probably shouldn't." – Drew Jan 29 '17 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.