Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!sgi.com!scotth From: scotth@corp.sgi.com (Scott Henry) Newsgroups: comp.sys.sgi Subject: Re: Emacs key-binding Message-ID: Date: 2 May 91 08:37:31 GMT References: <9105012129.AA29430@smaug.physics.mcgill.ca> Sender: news@odin.corp.sgi.com (Net News) Reply-To: scotth@sgi.com (Scott Henry) Organization: Silicon Graphics Inc, Mountain View, CA Lines: 96 In-Reply-To: igraham@SMAUG.PHYSICS.MCGILL.CA's message of 1 May 91 21:29:07 GMT In article <9105012129.AA29430@smaug.physics.mcgill.ca> igraham@SMAUG.PHYSICS.MCGILL.CA (Ian Graham) writes: ian> Hi, ian> At the request of a user I recently installed emacs on our Irises, both ian> the ordinary terminal version and an X version. These work fine, but ian> the person doing most of the fiddling with it wants to do key binding to ian> make the whole thing more convenient: In his case he wants to do ian> key binding on the IRIS keyboard -- In particular he wants to bind things ian> like the page-down key, arrow keys, insert, delete, etc to their obvious ian> functions. The problem is -- no-one here knows how to do it, either within ian> emacs or X. It is not clear to me whether some of this should be done ian> in X when running an X-version of emacs (we are running 4-Sight, not X, ian> so by this I mean that xemacs just pops an X-window under 4-Sight -- does ian> this mean that X remaps the keyboard just for this window?) ian> Basically, there seem to me to be 3 ways to remap keys, none of which I ian> know how to do (having had no need): ian> 1) NeWS -- fiddle something in user.ps (I don't know how to do this) ian> 2) X11 -- fiddle something in .xinitrc? (I don't know how to do this) ian> 3) emacs -- fiddle something else (" " " " " " " ) ian> I also don't know how they interact with each other -- i.e. does emacs ian> remapping remap on top of a NeWS/X remapping, etc? And for our case which ian> remapping should we be doing, and how? Under Irix release 3.3.*, keymappings are handled first by NeWS, then by X, and then by emacs, so changes are cumulative. Ie: if you swap the Caps_Lock and L_Ctrl keys in NeWS, the change will be in effect for all X clients, including emacs. A year ago (4/2/90) a patch for emacs 18.55 was posted to comp.emacs that added (among other things) support for x-rebind-key as an elisp primitive. There are slight changes in the patches needed for 18.57. Based on that patch, I wrote this x11 initialization file that maps the keypad: ================== electronically snip this line ================= ;; my version of key and mouse bindings for Gnu Emacs 18.55+ using X11 ;; and the various X-patches for keypad mapping ;; Also works with epoch 3.2 ;; ;; scott henry 5/3/90 (if (eq window-system 'x) (progn ;;; key bindings (requires the x-rebind-key patch) (if (boundp 'epoch::version) (fset 'x-rebind-key 'epoch::rebind-key)) (if (symbolp 'x-rebind-key) (progn ;; cursor keys (with shifted versions, if it works) (x-rebind-key "Up" 0 "") (x-rebind-key "Down" 0 "") (x-rebind-key "Right" 0 "") (x-rebind-key "Left" 0 "") (x-rebind-key "Up" 6 "4") (x-rebind-key "Down" 6 "4") (x-rebind-key "Right" 6 "\033f") (x-rebind-key "Left" 6 "\033b") ;; mini-keypad (edit keys) (x-rebind-key "Insert" 0 "") (x-rebind-key "Insert" 6 "\033w") (x-rebind-key "Next" 0 "4") (x-rebind-key "Prior" 0 "4") (x-rebind-key "Home" 0 "\033<") (x-rebind-key "End" 0 "\033>") ;; function keys (nothing bound yet) )) ;; sky-mouse stuff (setq *sky-mouse-tutorial* "/usr/local/elisp/sky-mouse/etc/MOUSE-TUTORIAL") (require 'sky-mouse "sky-mouse") ;(load "/usr/local/elisp/sky-mouse/epoch-help-patch") )) ================ end electronic snip =========================== Oh, yeah, I bound ^X4^D and ^X4^U to scroll-{down,up}-in-place (another available enhancement elisp file). If you can't find the elisp in the archive (ftp.brl.mil, in the file info-iris/info-iris.txt.23 I think), I can email the patches to you (please specify 18.55 or 18.57 version). \\scott -- Scott Henry / Traveller on Dragon Wings Information Services, / Help! My disclaimer is missing! Silicon Graphics, Inc / Politicians no baka!