Previous: , Up: Mastering Key Bindings in Emacs   [Index]


5.5.6 Reserved Keys

You can pick any keyboard combination you desire—even if that key bind is already taken, so be careful. But Emacs has set aside certain keys for use by users. Generally, all keys prefixed with ‘C-c ?’ (where ‘?’ is a single character) are reserved for you, and you alone. In practice most third-party packages don’t give a hoot and will gladly stuff their own key binds in there.

The other set of reserved keys are the F-keys from ‘F5’ and onwards.

Hyper and Super Prefix Keys

The other two prefix keys reserved to you are ‘hyper’ and ‘super’. They are remnants from ancient keyboards used in the 80s, but live on today in Emacs. Most PC-compatible keyboards won’t have a ‘super’ or ‘hyper’ key so some people rebind the Windows key and the Application Context key to be ‘hyper’ and ‘super’ instead.

resources/images/lisp-machine-keyboard-2-left

Figure 5.1: Symbolics’s lisp machine keyboard PN 365407 Rev C. (Photo by Joey Devilla.)

2

If you want to use ‘hyper’ then use the prefix key ‘H-’ (e.g., ‘H-q’) and if you want ‘super’ use the prefix key ‘s-’ (lower case).

On Mac OS X

;; set keys for Apple keyboard, for emacs in OS X
(setq mac-command-modifier 'meta) ; make cmd key do Meta
(setq mac-option-modifier 'super) ; make opt key do Super
(setq mac-control-modifier 'control) ; make Control key do Control
(setq ns-function-modifier 'hyper)  ; make Fn key do Hyper

Listing 5.1: set keys for Apple keyboard, for emacs in OS X


Footnotes

(2)

From http://ergoemacs.org/emacs/emacs_hyper_super_keys.html


Previous: Remapping Commands, Up: Mastering Key Bindings in Emacs   [Index]