From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: emacs keybinding syntaxes bewilderment Date: Fri, 14 Dec 2007 14:24:56 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197769295 22345 80.91.229.12 (16 Dec 2007 01:41:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Dec 2007 01:41:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 16 02:41:44 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J3iVi-000569-Tv for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Dec 2007 02:41:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J3iVY-0003wm-Kf for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Dec 2007 20:41:32 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!novia!novia!news.glorb.com!postnews.google.com!s8g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help, comp.emacs Original-Lines: 76 Original-NNTP-Posting-Host: 69.236.84.103 Original-X-Trace: posting.google.com 1197671097 19086 127.0.0.1 (14 Dec 2007 22:24:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 14 Dec 2007 22:24:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s8g2000prg.googlegroups.com; posting-host=69.236.84.103; posting-account=qPxGtQkAAADb6PWdLGiWVucht1ZDR6fn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/523.12 (KHTML, like Gecko) Version/3.0.4 Safari/523.12, gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:154664 comp.emacs:95955 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:50092 Archived-At: 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 "") '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-") '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 $B-t(B http://xahlee.org/