Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ucsd!ucsdhub!hp-sdd!apollo!vasta From: vasta@apollo.HP.COM (John Vasta) Newsgroups: gnu.emacs Subject: Re: More about X emacs weirdness Keywords: Shoulda asked this first... Message-ID: <488239e5.20b6d@apollo.HP.COM> Date: 7 Feb 90 22:24:00 GMT References: <2001@dover.sps.mot.com> Sender: root@apollo.HP.COM Reply-To: vasta@apollo.HP.COM (John Vasta) Distribution: usa Organization: Hewlett-Packard Company, Apollo Division; Chelmsford, MA Lines: 81 In article <2001@dover.sps.mot.com> cowan@soleil.sps.mot.com () writes: >What I want to do is customize my key mappings under X windows >emacs 18.55 (compiled on a Sun4, being X-served to a Visual >X-terminal). From gray@lucid.com I got the clue to use the >x-rebind-keys function and put the following in my startup >(.emacs) file: > > (x-rebind-key "Right" "Control_L" "\ef") > ; ctrl-right-arrow = forward word > >The weirdness that provoked my first question is that I'm >getting this message when I startup: > > "Symbol's function definition is void: x-rebind-key" > >Now, is that weird? Or normal? What's the problem? It sounds like the Lucid folk may be using the x-rebind-key function which was written by John Brezak at HP/Apollo. If you look in the x11fns.c file, you'll see that the function is mainly commented out. I think that all you need to do is replace it with this: DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, "Rebind KeySym, with ModifierSym, to new string NEWSTRING.\n\ KeySym and ModifierSym should be Strings representing the names of\n\ X keyboard keycap and modifier keycap name. If the ModifierSym is\n\ nill, then the KeySym's key will be bound to NEWSTRING for all modifier\n\ combinations.\n\ Common modifiers:\n\ Shift_L Shift_R Control_L Control_R Meta\n") (keycode, keymodifier, newstring) register Lisp_Object keycode; register Lisp_Object keymodifier; register Lisp_Object newstring; { char *rawstring; KeySym rawkey, rawmod[2]; int mod_len = 0; int strsize; /* * Check args */ CHECK_STRING (keycode, 1); if (!NULL (keymodifier)) CHECK_STRING (keymodifier, 2); CHECK_STRING (newstring, 3); /* * Get newstring and sizeof it */ strsize = XSTRING (newstring) ->size; rawstring = (char *) xmalloc (strsize); bcopy (XSTRING (newstring)->data, rawstring, strsize); /* * Translate key to keysym */ rawkey = XStringToKeysym(XSTRING(keycode)->data); /* * Translate modifier to keysym */ if (!NULL (keymodifier)) { rawmod[0] = XStringToKeysym(XSTRING(keymodifier)->data); mod_len++; } if (rawkey != NoSymbol) XRebindKeysym (XXdisplay, rawkey, rawmod, mod_len, rawstring, strsize); else error("Keysym \"%s\" unknown", XSTRING(keycode)->data); return Qnil; } John Vasta Hewlett-Packard Apollo Systems Division vasta@apollo.hp.com M.S. CHA-01-LT (508) 256-6600 x6362 300 Apollo Drive, Chelmsford, MA 01824 UUCP: {decwrl!decvax, mit-eddie, attunix}!apollo!vasta