aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-26 21:51:07 +0000
committerRichard M. Stallman1993-05-26 21:51:07 +0000
commit9d04a87aad56d7baeee6173a040b43981956cf49 (patch)
tree1b04706105d8ee37597ee235401d8946b6317aad /src
parentc469713a1e48f9de9d9af232d6c32d7ebccd7c8a (diff)
downloademacs-9d04a87aad56d7baeee6173a040b43981956cf49.tar.gz
emacs-9d04a87aad56d7baeee6173a040b43981956cf49.zip
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
(syms_of_xfns): Install them only if X11.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c87
1 files changed, 3 insertions, 84 deletions
diff --git a/src/xfns.c b/src/xfns.c
index b073b9161c2..54ce8bb266d 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3333,88 +3333,7 @@ See the documentation of `x-rebind-key' for more information.")
3333 } 3333 }
3334 return Qnil; 3334 return Qnil;
3335} 3335}
3336#else 3336#endif /* HAVE_X11 */
3337DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0,
3338 "Rebind KEYCODE, with shift bits SHIFT-MASK, to new string NEWSTRING.\n\
3339KEYCODE and SHIFT-MASK should be numbers representing the X keyboard code\n\
3340and shift mask respectively. NEWSTRING is an arbitrary string of keystrokes.\n\
3341If SHIFT-MASK is nil, then KEYCODE's key will be bound to NEWSTRING for\n\
3342all shift combinations.\n\
3343Shift Lock 1 Shift 2\n\
3344Meta 4 Control 8\n\
3345\n\
3346For values of KEYCODE, see /usr/lib/Xkeymap.txt (remember that the codes\n\
3347in that file are in octal!)\n\
3348\n\
3349NOTE: due to an X bug, this function will not take effect unless one has\n\
3350a `~/.Xkeymap' file. (See the documentation for the `keycomp' program.)\n\
3351This problem will be fixed in X version 11.")
3352
3353 (keycode, shift_mask, newstring)
3354 register Lisp_Object keycode;
3355 register Lisp_Object shift_mask;
3356 register Lisp_Object newstring;
3357{
3358 char *rawstring;
3359 int keysym, rawshift;
3360 int i, strsize;
3361
3362 CHECK_NUMBER (keycode, 1);
3363 if (!NILP (shift_mask))
3364 CHECK_NUMBER (shift_mask, 2);
3365 CHECK_STRING (newstring, 3);
3366 strsize = XSTRING (newstring)->size;
3367 rawstring = (char *) xmalloc (strsize);
3368 bcopy (XSTRING (newstring)->data, rawstring, strsize);
3369
3370 keysym = ((unsigned) (XINT (keycode))) & 255;
3371
3372 if (NILP (shift_mask))
3373 {
3374 for (i = 0; i <= 15; i++)
3375 XRebindCode (keysym, i<<11, rawstring, strsize);
3376 }
3377 else
3378 {
3379 rawshift = (((unsigned) (XINT (shift_mask))) & 15) << 11;
3380 XRebindCode (keysym, rawshift, rawstring, strsize);
3381 }
3382 return Qnil;
3383}
3384
3385DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0,
3386 "Rebind KEYCODE to list of strings STRINGS.\n\
3387STRINGS should be a list of 16 elements, one for each shift combination.\n\
3388nil as element means don't change.\n\
3389See the documentation of `x-rebind-key' for more information.")
3390 (keycode, strings)
3391 register Lisp_Object keycode;
3392 register Lisp_Object strings;
3393{
3394 register Lisp_Object item;
3395 register char *rawstring;
3396 KeySym rawkey, modifier[1];
3397 int strsize;
3398 register unsigned i;
3399
3400 CHECK_NUMBER (keycode, 1);
3401 CHECK_CONS (strings, 2);
3402 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255;
3403 for (i = 0; i <= 15; strings = Fcdr (strings), i++)
3404 {
3405 item = Fcar (strings);
3406 if (!NILP (item))
3407 {
3408 CHECK_STRING (item, 2);
3409 strsize = XSTRING (item)->size;
3410 rawstring = (char *) xmalloc (strsize);
3411 bcopy (XSTRING (item)->data, rawstring, strsize);
3412 XRebindCode (rawkey, i << 11, rawstring, strsize);
3413 }
3414 }
3415 return Qnil;
3416}
3417#endif /* not HAVE_X11 */
3418 3337
3419#ifdef HAVE_X11 3338#ifdef HAVE_X11
3420Visual * 3339Visual *
@@ -3694,6 +3613,8 @@ unless you set the mouse color.");
3694 defsubr (&Sx_display_visual_class); 3613 defsubr (&Sx_display_visual_class);
3695 defsubr (&Sx_display_backing_store); 3614 defsubr (&Sx_display_backing_store);
3696 defsubr (&Sx_display_save_under); 3615 defsubr (&Sx_display_save_under);
3616 defsubr (&Sx_rebind_key);
3617 defsubr (&Sx_rebind_keys);
3697#if 0 3618#if 0
3698 defsubr (&Sx_track_pointer); 3619 defsubr (&Sx_track_pointer);
3699 defsubr (&Sx_grab_pointer); 3620 defsubr (&Sx_grab_pointer);
@@ -3711,8 +3632,6 @@ unless you set the mouse color.");
3711#if 0 3632#if 0
3712 defsubr (&Sx_horizontal_line); 3633 defsubr (&Sx_horizontal_line);
3713#endif 3634#endif
3714 defsubr (&Sx_rebind_key);
3715 defsubr (&Sx_rebind_keys);
3716 defsubr (&Sx_open_connection); 3635 defsubr (&Sx_open_connection);
3717 defsubr (&Sx_close_current_connection); 3636 defsubr (&Sx_close_current_connection);
3718 defsubr (&Sx_synchronize); 3637 defsubr (&Sx_synchronize);