Mercurial > emacs
changeset 3141:ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
(syms_of_xfns): Install them only if X11.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 26 May 1993 21:51:07 +0000 |
parents | 852864d39b0a |
children | 3466d61e7b09 |
files | src/xfns.c |
diffstat | 1 files changed, 3 insertions(+), 84 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xfns.c Wed May 26 21:50:00 1993 +0000 +++ b/src/xfns.c Wed May 26 21:51:07 1993 +0000 @@ -3333,88 +3333,7 @@ } return Qnil; } -#else -DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, - "Rebind KEYCODE, with shift bits SHIFT-MASK, to new string NEWSTRING.\n\ -KEYCODE and SHIFT-MASK should be numbers representing the X keyboard code\n\ -and shift mask respectively. NEWSTRING is an arbitrary string of keystrokes.\n\ -If SHIFT-MASK is nil, then KEYCODE's key will be bound to NEWSTRING for\n\ -all shift combinations.\n\ -Shift Lock 1 Shift 2\n\ -Meta 4 Control 8\n\ -\n\ -For values of KEYCODE, see /usr/lib/Xkeymap.txt (remember that the codes\n\ -in that file are in octal!)\n\ -\n\ -NOTE: due to an X bug, this function will not take effect unless one has\n\ -a `~/.Xkeymap' file. (See the documentation for the `keycomp' program.)\n\ -This problem will be fixed in X version 11.") - - (keycode, shift_mask, newstring) - register Lisp_Object keycode; - register Lisp_Object shift_mask; - register Lisp_Object newstring; -{ - char *rawstring; - int keysym, rawshift; - int i, strsize; - - CHECK_NUMBER (keycode, 1); - if (!NILP (shift_mask)) - CHECK_NUMBER (shift_mask, 2); - CHECK_STRING (newstring, 3); - strsize = XSTRING (newstring)->size; - rawstring = (char *) xmalloc (strsize); - bcopy (XSTRING (newstring)->data, rawstring, strsize); - - keysym = ((unsigned) (XINT (keycode))) & 255; - - if (NILP (shift_mask)) - { - for (i = 0; i <= 15; i++) - XRebindCode (keysym, i<<11, rawstring, strsize); - } - else - { - rawshift = (((unsigned) (XINT (shift_mask))) & 15) << 11; - XRebindCode (keysym, rawshift, rawstring, strsize); - } - return Qnil; -} - -DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0, - "Rebind KEYCODE to list of strings STRINGS.\n\ -STRINGS should be a list of 16 elements, one for each shift combination.\n\ -nil as element means don't change.\n\ -See the documentation of `x-rebind-key' for more information.") - (keycode, strings) - register Lisp_Object keycode; - register Lisp_Object strings; -{ - register Lisp_Object item; - register char *rawstring; - KeySym rawkey, modifier[1]; - int strsize; - register unsigned i; - - CHECK_NUMBER (keycode, 1); - CHECK_CONS (strings, 2); - rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255; - for (i = 0; i <= 15; strings = Fcdr (strings), i++) - { - item = Fcar (strings); - if (!NILP (item)) - { - CHECK_STRING (item, 2); - strsize = XSTRING (item)->size; - rawstring = (char *) xmalloc (strsize); - bcopy (XSTRING (item)->data, rawstring, strsize); - XRebindCode (rawkey, i << 11, rawstring, strsize); - } - } - return Qnil; -} -#endif /* not HAVE_X11 */ +#endif /* HAVE_X11 */ #ifdef HAVE_X11 Visual * @@ -3694,6 +3613,8 @@ defsubr (&Sx_display_visual_class); defsubr (&Sx_display_backing_store); defsubr (&Sx_display_save_under); + defsubr (&Sx_rebind_key); + defsubr (&Sx_rebind_keys); #if 0 defsubr (&Sx_track_pointer); defsubr (&Sx_grab_pointer); @@ -3711,8 +3632,6 @@ #if 0 defsubr (&Sx_horizontal_line); #endif - defsubr (&Sx_rebind_key); - defsubr (&Sx_rebind_keys); defsubr (&Sx_open_connection); defsubr (&Sx_close_current_connection); defsubr (&Sx_synchronize);