2
votes

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?

2

2 Answers

5
votes

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.

1
votes

To clarify a bit: If you are using Emacs with a window manager, then you can bind the key [(control shift ?s)], which is C-S-s (aka C-S, but not written this way in Emacs). This key is definitely different from the ASCII control character C-s, which has no lowercase/uppercase versions.

So the answer is (a) you have to be using a graphics terminal; (b) bind [(control shift ?s)] to get the uppercase version.