From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Dyballa Newsgroups: gmane.emacs.help Subject: Re: emacs-snapshot keybinding problem Date: Sat, 31 Dec 2005 18:21:01 +0100 Message-ID: <9bc9d7eb4441de7f9ae098a8cf925706@Web.DE> References: <87zmmjyz2z.fsf-monnier+gnu.emacs.help@gnu.org> <8764p6u0mp.fsf@magma.ca> <89094436dbe19fc651e2bc3fd10bfcce@Web.DE> <87y822sagk.fsf@magma.ca> <3c110c9e9c722c8b8843bee0bea47a2f@Web.DE> <87hd8p5l5p.fsf@magma.ca> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1136050994 1256 80.91.229.2 (31 Dec 2005 17:43:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 31 Dec 2005 17:43:14 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 31 18:43:12 2005 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eskl5-0000mR-Hx for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Dec 2005 18:43:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EskmX-0002jp-Li for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Dec 2005 12:44:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EskRE-0003FK-Cm for help-gnu-emacs@gnu.org; Sat, 31 Dec 2005 12:22:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EskRD-0003Ey-9m for help-gnu-emacs@gnu.org; Sat, 31 Dec 2005 12:22:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EskRC-0003Et-QY for help-gnu-emacs@gnu.org; Sat, 31 Dec 2005 12:22:38 -0500 Original-Received: from [217.72.192.225] (helo=smtp07.web.de) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EskRv-0004P6-TL for help-gnu-emacs@gnu.org; Sat, 31 Dec 2005 12:23:24 -0500 Original-Received: from [84.245.174.119] (helo=[192.168.1.2]) by smtp07.web.de with asmtp (TLSv1:RC4-SHA:128) (WEB.DE 4.105 #340) id 1EskPg-0001yT-00; Sat, 31 Dec 2005 18:21:05 +0100 In-Reply-To: <87hd8p5l5p.fsf@magma.ca> X-Image-Url: http://homepage.mac.com/sparifankal/.cv/thumbs/me.thumbnail Original-To: Angelina Carlton X-Mailer: Apple Mail (2.623) X-Sender: Peter_Dyballa@web.de 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:32325 Archived-At: Am 31.12.2005 um 16:41 schrieb Angelina Carlton: >> keycode 115 = Hyper >> add Mod4 = Hyper >> keycode 115 = super >> add Mod5 = super > > Ok, for this system it complains that Hyper and super are not valid > keysyms Sorry! It has to be with _L or _R, and here in Mac OS X it's Super (with _L or _R), uppercase! > > So my function keys now go all the way up to F16 :-) and I have OPTL > set > to Hyper_L and OPTR set to Super_R, I now need to > learn the syntax to bind something to the Super and Hyper keys > > (global-set-key [(hyper q)] 'some-function) does not work. (global-set-key [s-f1] 'replace-string) (global-set-key [H-f] 'end-of-defun) S- is the Shift key C- is the Control key M- is the Meta key A- is the Alt key H- is the Hyper key s- is the super key A simple and looong text way to find out, is to invoke global-set-key interactively, press the key combination, and then invoke repeat-complex-command, which is C-x Esc Esc or C-x M-: or C-x M-ESC. In minibuffer the keybinding is listed. C-a: you're at the expression's beginning, C-k: you've killed the expression, C-g: minibuffer closes. Now enter ~/.emacs and yank that line near the other global-set-key's: finished! > > Incidentally these function keys still get overwritten in emacs22, I > have > not tried to address this yet because as you pointed out, my > key mappings were incorrect to begin with, even in emacs21 so one step > at > a time I suppose :) > You have to make a difference between GNU Emacs running inside a terminal (emulation), or as an X client in its own window. The keys you set with xmodmap do not exist in nowindows mode. XTerm and other terminal emulations have kind of 'text bindings' to keys, particularly to function keys. The syntax to set up these X resources in ~/.Xdefaults is not easy, I presume I copied these lines from somewhere: XTerm*vt220*VT100.translations: #override \n\ ~ShiftF1: string(0x1b) string("OP") \n \ ~ShiftF2: string(0x1b) string("OQ") \n \ ~ShiftF3: string(0x1b) string("OR") \n \ ~ShiftF4: string(0x1b) string("OS") \n \ ~ShiftF5: string(0x1b) string("[16~") \n \ ~ShiftF6: string(0x1b) string("[17~") \n \ ~ShiftF7: string(0x1b) string("[18~") \n \ ~ShiftF8: string(0x1b) string("[19~") \n \ ~ShiftF9: string(0x1b) string("[20~") \n \ ~ShiftF10: string(0x1b) string("[21~") \n \ ~ShiftF11: string(0x1b) string("[28~") \n \ ~ShiftF12: string(0x1b) string("[29~") \n \ ShiftF1: string(0x1b) string("[23~") \n \ ShiftF2: string(0x1b) string("[24~") \n \ ShiftF3: string(0x1b) string("[25~") \n \ ShiftF4: string(0x1b) string("[26~") \n \ ShiftF5: string(0x1b) string("[K~") \n \ ShiftF6: string(0x1b) string("[31~") \n \ ShiftF7: string(0x1b) string("[31~") \n \ ShiftF8: string(0x1b) string("[32~") \n \ ShiftF9: string(0x1b) string("[33~") \n \ ShiftF10: string(0x1b) string("[34~") \n \ ShiftF11: string(0x1b) string("[28~") \n \ ShiftF12: string(0x1b) string("[29~") \n !XTerm*VT100.translations: #override \ ! BackSpace: string("\010") \n\ ! ShiftTab: string("\033[Z") \n\ ! Ctrlminus: string("\037") \n\ ! Home: string("\033[1~") \n\ ! End: string("\033[4~") \n\ ! Delete: string("\033[3~") \n\ ! ShiftDelete: string("\177") \n\ ! CtrlDelete: string("\010") \n\ ! AltReturn: string("\033\015") \n\ ! Altspace: string("\033\040") \n \033 is the same as 0x1b wrapped in a string() call solely. Some X clients understand the modifiers "Alt," "Ctrl," "Meta," or "Shift." If xterms does too, and maybe understands Hyper or Super too, you have the option to define your own extra set of key sequences these key produce when pressed with any of these modifiers, that should work without windows. In extending the xterm.el code you might get these extra layers. To activate these X resources you can merge them via 'xrdb -merge < ~/.Xdefaults'. -- Greetings Pete Well done is better than well said. ---- Benjamin Franklin