unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* emacs keybinding syntaxes bewilderment
@ 2007-12-14 22:24 Xah Lee
  2007-12-14 23:15 ` B. T. Raven
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Xah Lee @ 2007-12-14 22:24 UTC (permalink / raw)
  To: help-gnu-emacs

recently i took some time to study the various syntax variations for
keybinding in emacs.
Here's a list:

 ; equivalent code for a single keystroke
 (global-set-key "b" 'func-name)
 (global-set-key [98] 'func-name)
 (global-set-key [?b] 'func-name)
 (global-set-key [(?b)] 'func-name)
 (global-set-key (kbd "b") 'func-name)

 ; equivalent code for a named special key: Enter
 (global-set-key "\r" 'func-name)
 (global-set-key [?\r] 'func-name)
 (global-set-key [13] 'func-name)
 (global-set-key [(13)] 'func-name)
 (global-set-key [return] 'func-name)
 (global-set-key [?\^M] 'func-name)
 (global-set-key [?\^m] 'func-name)
 (global-set-key [?\C-M] 'func-name)
 (global-set-key [?\C-m] 'func-name)
 (global-set-key [(?\C-m)] 'func-name)
 (global-set-key (kbd "RET") 'func-name)
 (global-set-key (kbd "<return>") 'func-name)

 ; equivalent code for binding 1 mod key + 1 letter key: Meta+b
 (global-set-key "\M-b" 'func-name)
 (global-set-key [?\M-b]  'func-name)
 (global-set-key [(meta 98)]    'func-name)
 (global-set-key [(meta b)]    'func-name)
 (global-set-key [(meta ?b)]    'func-name)
 (global-set-key (kbd "M-b") 'func-name)

 ; equivalent code for binding 1 mod key + 1 special key: Meta+Enter
 (global-set-key [M-return]    'func-name)
 (global-set-key [\M-return]    'func-name)
 (global-set-key [(meta return)]    'func-name)
 (global-set-key (kbd "M-<return>") 'func-name)

; equivalent code for binding Meta + cap letter key: Meta Shift b
 (global-set-key (kbd "M-B") 'kill-this-buffer)
 (global-set-key "\M-\S-b" 'backward-word)
 (global-set-key "\S-\M-b" 'backward-word)
 (global-set-key "\M-B" 'forward-word)

 (global-set-key [?\M-S-b] 'backward-word) ; invalid-read-syntax
 (global-set-key [?\M-?\S-b] 'forward-word) ; invalid-read-syntax
 (global-set-key [?\M-\S-b] 'forward-word) ; compile but no effect

 (global-set-key [?\M-B] 'forward-word)
 (global-set-key [\M-B] 'backward-word) ; compile but no effect

 (global-set-key [(meta shift b)] 'func-name)
 (global-set-key [(shift meta b)] 'func-name)

 (global-set-key (kbd "M-B") 'backward-word)
 (global-set-key (kbd "M-S-b") 'forward-word) ; compile but no effect

; Meta + shifted symbol key.
 (global-set-key (kbd "M-@") 'backward-word) ; good
 (global-set-key (kbd "M-S-2") 'forward-word) ; compile but no effect

What the hell!

Note: this study is not complete. I have yet to add examplary
variations for key sequences. Also, i don't fully yet understand why
some of them does not work.

Also, a question: recently i learned that to make Mac keyboard's
Option key to be hyper, i can use (setq mac-option-modifier 'hyper).
Is there something similar on Windows Emacs to make the WindowKey
hyper? Thanks.

  Xah
  xah@xahlee.org
\xAD\xF4 http://xahlee.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2007-12-19  2:27 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-14 22:24 emacs keybinding syntaxes bewilderment Xah Lee
2007-12-14 23:15 ` B. T. Raven
2007-12-15  1:57   ` Xah Lee
2007-12-15 16:48 ` rustom
2007-12-16  7:22   ` Mike Mattie
     [not found]   ` <mailman.5061.1197789814.18990.help-gnu-emacs@gnu.org>
2007-12-16  8:25     ` rustom
2007-12-16  8:56       ` Harald Hanche-Olsen
2007-12-16 16:39         ` rustom
2007-12-16 19:37           ` Harald Hanche-Olsen
2007-12-16 23:21             ` Peter Dyballa
2007-12-16 23:33               ` Lennart Borgman (gmail)
2007-12-16 23:50                 ` Peter Dyballa
2007-12-17 10:17           ` Sebastian Tennant
     [not found]           ` <mailman.5091.1197886901.18990.help-gnu-emacs@gnu.org>
2007-12-17 12:56             ` Romain Francoise
2007-12-17  9:38   ` Tassilo Horn
2007-12-18  6:12 ` Xah Lee
2007-12-19  2:27 ` Xah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).