aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Love2002-10-30 19:12:37 +0000
committerDave Love2002-10-30 19:12:37 +0000
commitdbd4b028f63dfb1934059a618815df8d41825c1f (patch)
tree8cbba61b7467547752c92bac68e9ca93d194ddfc /src
parenta8c834bfdb3ecf52075bd81d38d03d3135ba529e (diff)
downloademacs-dbd4b028f63dfb1934059a618815df8d41825c1f.tar.gz
emacs-dbd4b028f63dfb1934059a618815df8d41825c1f.zip
(Qeql): Declare.
(Vx_keysym_table): New. (syms_of_xterm): Initialize it. (XTread_socket): Use it. Deal with ASCII keysyms. (XSetIMValues) [HAVE_X11R6]: Prototype.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c50
1 files changed, 44 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 31b4938bc59..ebc9fb734fc 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -380,7 +380,7 @@ extern Lisp_Object Vcommand_line_args, Vsystem_name;
380 380
381extern Lisp_Object Vx_no_window_manager; 381extern Lisp_Object Vx_no_window_manager;
382 382
383extern Lisp_Object Qface, Qmouse_face; 383extern Lisp_Object Qface, Qmouse_face, Qeql;
384 384
385extern int errno; 385extern int errno;
386 386
@@ -391,6 +391,7 @@ extern EMACS_INT extra_keyboard_modifiers;
391/* The keysyms to use for the various modifiers. */ 391/* The keysyms to use for the various modifiers. */
392 392
393Lisp_Object Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym, Vx_super_keysym; 393Lisp_Object Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym, Vx_super_keysym;
394Lisp_Object Vx_keysym_table;
394static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value; 395static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value;
395 396
396static Lisp_Object Qvendor_specific_keysyms; 397static Lisp_Object Qvendor_specific_keysyms;
@@ -8777,7 +8778,7 @@ xaw_jump_callback (widget, client_data, call_data)
8777 i.e. line or page up or down. WIDGET is the Xaw scroll bar 8778 i.e. line or page up or down. WIDGET is the Xaw scroll bar
8778 widget. CLIENT_DATA is a pointer to the scroll_bar structure for 8779 widget. CLIENT_DATA is a pointer to the scroll_bar structure for
8779 the scroll bar. CALL_DATA is an integer specifying the action that 8780 the scroll bar. CALL_DATA is an integer specifying the action that
8780 has taken place. It's magnitude is in the range 0..height of the 8781 has taken place. Its magnitude is in the range 0..height of the
8781 scroll bar. Negative values mean scroll towards buffer start. 8782 scroll bar. Negative values mean scroll towards buffer start.
8782 Values < height of scroll bar mean line-wise movement. */ 8783 Values < height of scroll bar mean line-wise movement. */
8783 8784
@@ -10815,11 +10816,38 @@ XTread_socket (sd, bufp, numchars, expected)
10815#endif 10816#endif
10816 )) 10817 ))
10817 { 10818 {
10819 Lisp_Object c;
10820
10818 if (temp_index == sizeof temp_buffer / sizeof (short)) 10821 if (temp_index == sizeof temp_buffer / sizeof (short))
10819 temp_index = 0; 10822 temp_index = 0;
10820 temp_buffer[temp_index++] = keysym; 10823 temp_buffer[temp_index++] = keysym;
10821 bufp->kind = NON_ASCII_KEYSTROKE_EVENT; 10824 /* First deal with keysyms which have
10822 bufp->code = keysym; 10825 defined translations to characters. */
10826 if (keysym >= 32 && keysym < 128)
10827 /* Avoid explicitly decoding each ASCII
10828 character. */
10829 {
10830 bufp->kind = ASCII_KEYSTROKE_EVENT;
10831 bufp->code = c;
10832 }
10833 else if (! EQ ((c = Fgethash (make_number (keysym),
10834 Vx_keysym_table,
10835 Qnil)),
10836 Qnil))
10837 {
10838 bufp->kind = (SINGLE_BYTE_CHAR_P (c)
10839 ? ASCII_KEYSTROKE_EVENT
10840 : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
10841 bufp->code = c;
10842 }
10843 else
10844 {
10845 /* Not a character keysym.
10846 make_lispy_event will convert it to a
10847 symbolic key. */
10848 bufp->kind = NON_ASCII_KEYSTROKE_EVENT;
10849 bufp->code = keysym;
10850 }
10823 XSETFRAME (bufp->frame_or_window, f); 10851 XSETFRAME (bufp->frame_or_window, f);
10824 bufp->arg = Qnil; 10852 bufp->arg = Qnil;
10825 bufp->modifiers 10853 bufp->modifiers
@@ -10831,7 +10859,7 @@ XTread_socket (sd, bufp, numchars, expected)
10831 numchars--; 10859 numchars--;
10832 } 10860 }
10833 else if (numchars > nbytes) 10861 else if (numchars > nbytes)
10834 { 10862 { /* Raw bytes, not keysym. */
10835 register int i; 10863 register int i;
10836 register int c; 10864 register int c;
10837 int nchars, len; 10865 int nchars, len;
@@ -12614,6 +12642,11 @@ xim_destroy_callback (xim, client_data, call_data)
12614 12642
12615#endif /* HAVE_X11R6 */ 12643#endif /* HAVE_X11R6 */
12616 12644
12645#ifdef HAVE_X11R6
12646/* This isn't prototyped in OSF 5.0 or 5.1a. */
12647extern char *XSetIMValues P_ ((XIM, ...));
12648#endif
12649
12617/* Open the connection to the XIM server on display DPYINFO. 12650/* Open the connection to the XIM server on display DPYINFO.
12618 RESOURCE_NAME is the resource name Emacs uses. */ 12651 RESOURCE_NAME is the resource name Emacs uses. */
12619 12652
@@ -12640,7 +12673,6 @@ xim_open_dpy (dpyinfo, resource_name)
12640#ifdef HAVE_X11R6 12673#ifdef HAVE_X11R6
12641 destroy.callback = xim_destroy_callback; 12674 destroy.callback = xim_destroy_callback;
12642 destroy.client_data = (XPointer)dpyinfo; 12675 destroy.client_data = (XPointer)dpyinfo;
12643 /* This isn't prototyped in OSF 5.0. */
12644 XSetIMValues (xim, XNDestroyCallback, &destroy, NULL); 12676 XSetIMValues (xim, XNDestroyCallback, &destroy, NULL);
12645#endif 12677#endif
12646 } 12678 }
@@ -15362,6 +15394,12 @@ For example, `super' means use the Super_L and Super_R keysyms. The
15362default is nil, which is the same as `super'. */); 15394default is nil, which is the same as `super'. */);
15363 Vx_super_keysym = Qnil; 15395 Vx_super_keysym = Qnil;
15364 15396
15397 DEFVAR_LISP ("x-keysym-table", &Vx_keysym_table,
15398 doc: /* Hash table of character codes indexed by X keysym codes. */);
15399 Vx_keysym_table = make_hash_table (Qeql, make_number (900),
15400 make_float (DEFAULT_REHASH_SIZE),
15401 make_float (DEFAULT_REHASH_THRESHOLD),
15402 Qnil, Qnil, Qnil);
15365} 15403}
15366 15404
15367#endif /* HAVE_X_WINDOWS */ 15405#endif /* HAVE_X_WINDOWS */