views:

232

answers:

1

I'm trying to teach Emacs standard shortcut keys. I use emacs23-nox version from Debian, often through SSH connection. One of those is Ctrl+Shift+S for SaveAs. The relevant part of configuration looks like this:

    (global-set-key (kbd "C-S") 'write-file)
    (global-set-key (kbd "C-s") 'save-buffer)

but causes either both Ctrl+Shift+S and Ctrl+S invoke 'save-buffer (or 'write-file, depending on which line comes last). I also tried "C-S-s" instead of "C-S".

No Use of Shift Key section of Why Emacs's Keyboard Shortcuts Are Painful says it's not possible. I read this answer, but the accepted solution doesn't work for me (C-h k Ctrl+Shift+S prints C-s).

Is there a way to make Emacs (the no GUI version) differentiate between Ctrl+Shift+S and Ctrl+S?

+3  A: 

You can't, there isn't any provision in the character sets for uppercase control characters. The only way you can get shift and control is by going direct to the windowing system, so you need the GUI version.

NikkiA
On a related note, it is a good idea to bind keys with shift and control to commands that require GUI. Because unbound keys are scarce resource in terminal Emacs.
RamyenHead