aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-12-23 14:37:04 +0200
committerEli Zaretskii2022-12-23 14:37:04 +0200
commit6dda2106ece7c307ed5c0a6cb892e736516effeb (patch)
tree8385c15915e25c6a42a81af94a661cf277be64f7
parenta0738e8ad1384e40c8eebca41b16a0b5125d625b (diff)
downloademacs-6dda2106ece7c307ed5c0a6cb892e736516effeb.tar.gz
emacs-6dda2106ece7c307ed5c0a6cb892e736516effeb.zip
; Improve documentation of "C-x @"
* doc/emacs/custom.texi (Modifier Keys): Document how to enter Shift, Control, and Meta using "C-x @". * lisp/simple.el (function-key-map): Add commentary to "C-x @" bindings to make them easier to discover.
-rw-r--r--doc/emacs/custom.texi6
-rw-r--r--lisp/simple.el2
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index aaf41d2aef1..f75512a00e9 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1990,13 +1990,17 @@ to assign meanings to key bindings that use these modifiers. The
1990modifier bits are labeled as @samp{s-}, @samp{H-} and @samp{A-} 1990modifier bits are labeled as @samp{s-}, @samp{H-} and @samp{A-}
1991respectively. 1991respectively.
1992 1992
1993@cindex modifier keys unsupported by keyboard
1993 Even if your keyboard lacks these additional modifier keys, you can 1994 Even if your keyboard lacks these additional modifier keys, you can
1994enter it using @kbd{C-x @@}: @kbd{C-x @@ h} adds the Hyper flag to 1995enter them using @kbd{C-x @@}: @kbd{C-x @@ h} adds the Hyper flag to
1995the next character, @kbd{C-x @@ s} adds the Super flag, and 1996the next character, @kbd{C-x @@ s} adds the Super flag, and
1996@kbd{C-x @@ a} adds the Alt flag. For instance, @kbd{C-x @@ h 1997@kbd{C-x @@ a} adds the Alt flag. For instance, @kbd{C-x @@ h
1997C-a} is a way to enter @kbd{Hyper-Control-a}. (Unfortunately, there 1998C-a} is a way to enter @kbd{Hyper-Control-a}. (Unfortunately, there
1998is no way to add two modifiers by using @kbd{C-x @@} twice for the 1999is no way to add two modifiers by using @kbd{C-x @@} twice for the
1999same character, because the first one goes to work on the @kbd{C-x}.) 2000same character, because the first one goes to work on the @kbd{C-x}.)
2001You can similarly enter the Shift, Control, and Meta modifiers by
2002using @kbd{C-x @ S}, @kbd{C-x @ c}, and @kbd{C-x @ m}, respectively,
2003although this is rarely needed.
2000 2004
2001@node Function Keys 2005@node Function Keys
2002@subsection Rebinding Function Keys 2006@subsection Rebinding Function Keys
diff --git a/lisp/simple.el b/lisp/simple.el
index f85428ca740..4551b749d56 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10053,6 +10053,8 @@ PREFIX is the string that represents this modifier in an event type symbol."
10053 event-type 10053 event-type
10054 (cons event-type (cdr event))))))) 10054 (cons event-type (cdr event)))))))
10055 10055
10056;; This is what makes "C-x @" followed by [hsmaSc] work even though
10057;; you won't find any (define-key ctl-x-map "@" ...) binding.
10056(define-key function-key-map [?\C-x ?@ ?h] 'event-apply-hyper-modifier) 10058(define-key function-key-map [?\C-x ?@ ?h] 'event-apply-hyper-modifier)
10057(define-key function-key-map [?\C-x ?@ ?s] 'event-apply-super-modifier) 10059(define-key function-key-map [?\C-x ?@ ?s] 'event-apply-super-modifier)
10058(define-key function-key-map [?\C-x ?@ ?m] 'event-apply-meta-modifier) 10060(define-key function-key-map [?\C-x ?@ ?m] 'event-apply-meta-modifier)