0

My problem is that I want to bind Control + Backspace combination to backward-delete-word function. However, it doesn't seem possible because emacs doesn't detect the Control key in combination with backspace.

I detected that by looking at the "logger" (C-h l). So if I press Backspace, it shows DEL. If I press Control + Backspace, it still shows DEL.

Is there any way to achieve that?

I have read and tried other questions, but couldn't fix it.

Ciprian Tomoiagă
  • 3,773
  • 4
  • 41
  • 65
  • 2
    "I have read and tried other questions, but couldn't fix it." doesn't help us if you don't link to them. I assume you're using Emacs in a terminal, and `` isn't a sequence which your terminal is sending to Emacs. – phils Nov 25 '13 at 04:52
  • http://serverfault.com/questions/190351/control-punctuation-doesnt-register-in-terminal/190366 – phils Nov 25 '13 at 04:55
  • 2
    There are lots of duplicate Q&As. In short, you need to determine whether your terminal actually differentiates those key sequences. If so, you can resolve this. If not, you can't. This one might get you started: http://stackoverflow.com/questions/4623630/emacs-control-shift-up-doesnt-work – phils Nov 25 '13 at 04:59
  • You were right, it was the terminal that wasn't sending the correct sequence. At the time I solved it by choosing a different combination. Thanks! – Ciprian Tomoiagă Oct 27 '14 at 17:15

1 Answers1

2

As @phils pointed out, if you are using Emacs in a terminal (e.g. emacs -nw) instead of as a GUI (no -nw command-line option), and if you are not on MS Windows, then by default certain key sequences are not available to you.

However, it might still be possible for you to configure the terminal (e.g., xterm) so that it in fact supports some such key sequences for Emacs. See this comment by the Emacs maintainer in the discussion of Emacs bug #10387.

(That said, you might find it simpler to just use a different key sequence. Or switch to the GUI version of Emacs.)

Drew
  • 29,895
  • 7
  • 74
  • 104
  • I remember now, after almost one year, that indeed the problem was with the terminal. I just chose another combination and got used to it. Thank you! – Ciprian Tomoiagă Oct 27 '14 at 17:12