2

I wanted to define a key binding C-x O (similar to C-x o but with a capital O). Before doing that, I tried it to see if it is already used. But it seems that Shift-o is just treated as o without holding the Shift. The echo line shows C-x o instead.

I have used key combinations of Shift with other modifiers, e.g. M-< goes to the beginning of buffer but M-, doesn't.

But when used alone, is Shift always ignored as in C-x S-o?

Also, this makes me wonder:

Is Shift key a modifier just as Control and Meta?; or is it not a modifier, but rather just used to change the character that follows, e.g. from , to < and o to O?

Also, I looked up the key C-x S-o with C-h k and got:

C-x o (translated from C-x O) runs the command other-window ...

It is bound to C-x o.

It did say, "translated from C-x O". Does this translation always happen? Would it be wrong if I go against it and define C-x S-o to do something else?

(This is with Emacs 28 in Ubuntu 22.04)

0

1 Answer 1

4

Is Shift key a modifier just as Control and Meta?; or is it not a modifier, but rather just used to change the character that follows, e.g. from , to < and o to O?

AFAIK it is both: pressing Shift and o will cause Emacs to see O with the Shift modifier bit set.

It did say, "translated from C-x O". Does this translation always happen?

This behavior is controlled by the variable translate-upper-case-bindings.

Would it be wrong if I go against it and define C-x S-o to do something else?

No, you wouldn’t be wrong, as the translation happens only if the lowercase binding exists but the uppercase one doesn’t. See C-h v translate-upper-case-bindings RET for more details.

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.