1

Sure, I'm newbie to Emacs and I've been trying to figure this one out for a little while now.

I got the following key binding in my .emacs file:

(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)

When I press the keys:

Ctrl+c release then Ctrl+Shift+< ,

Emacs tells me

C-c < is undefined

If I do it without the Shift:

Ctrl+c release then Ctrl+< ,

Emacs tells me

C-c ,-

I'm kind of confused, but it seems that when I press Shift the Ctrl key gets reset. Like if pressing Shift would null the effect of the Ctrl key.

Question is then; how do I press the "C-c C-<" key binding? And an explanation and what I'm doing wrong would be nice.

System information:

GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.14.12) of 2015-04-17 on buildvm-04.phx2.fedoraproject.org

Running on the terminal; emacs -nw on GNOME Terminal 3.14.3

mimoralea
  • 9,590
  • 7
  • 58
  • 59
  • 1
    Your code is correct, and so is your *first* explanation of how to use it. Try with Emacs -Q and use something like `'help-for-help` as a function tied to your key-binding so that you can see whether that works correctly. – lawlist May 24 '15 at 19:42
  • I tried that... `emacs -nw -Q` (it seemed to open emacs without the `.emacs` configurations since the theme was different. I eval `(global-set-key (kbd "C-c C-<") 'help-for-help) ` and do the `Ctrl-c + Ctrl-<` and got the same error `C-c < is undefined` – mimoralea May 25 '15 at 00:33
  • Also, when I press just `Ctrl+<` I get the '<' character on the buffer... just as if `Ctrl` was not being taken. When I do `M-<` and `M->` the commands work fine – mimoralea May 25 '15 at 00:38
  • Actually, it might be related to being in the terminal... I opened Emacs on the GUI and it works find. Almost got to the bottom of this, thought still not sure how to make it work on the terminal. – mimoralea May 25 '15 at 00:47
  • There are a few threads you'll find by Google that discuss which keys are generally unavailable to Emacs when working in the terminal. Some particular terminals may offer methods of accessing keys that others do not. – lawlist May 25 '15 at 00:59
  • http://emacs.stackexchange.com/questions/328/how-to-override-keybindings-for-term http://stackoverflow.com/questions/4167296/certain-keybindings-dont-work-when-using-emacs-in-a-terminal http://superuser.com/questions/374800/how-to-get-gnome-terminal-to-not-mess-up-emacs-keybindings http://serverfault.com/questions/81688/problem-with-ctrl-tab-keybinding-in-emacs-in-gnome-terminal This might not be worthy. If someone knows, and has done it already, please let me know. @lawlist Thanks for your help! – mimoralea May 25 '15 at 01:18

0 Answers0