Commit 51f3cc3b authored by Dave Love's avatar Dave Love
Browse files

(use_xim): Initialize.

(xim_open_dpy, xim_initialize, xim_close_dpy): Use use_xim.
(x_term_init): Maybe set use_xim.
parent 7ad6faa7
......@@ -158,6 +158,8 @@ extern void _XEditResCheckMessages ();
#define abs(x) ((x) < 0 ? -(x) : (x))
/* Default to using XIM if available. */
int use_xim = 1;
/* Non-nil means Emacs uses toolkit scroll bars. */
......@@ -6461,7 +6463,7 @@ handle_one_xevent (dpyinfo, eventp, bufp_r, numcharsp, finish)
require = decoding_buffer_size (&coding, nbytes);
p = (unsigned char *) alloca (require);
coding.mode |= CODING_MODE_LAST_BLOCK;
/* We explicitely disable composition
/* We explicitly disable composition
handling because key data should
not contain any composition
sequence. */
......@@ -8025,10 +8027,12 @@ xim_open_dpy (dpyinfo, resource_name)
struct x_display_info *dpyinfo;
char *resource_name;
{
#ifdef USE_XIM
XIM xim;
xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name, EMACS_CLASS);
if (use_xim)
{
xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name,
EMACS_CLASS);
dpyinfo->xim = xim;
if (xim)
......@@ -8046,10 +8050,10 @@ xim_open_dpy (dpyinfo, resource_name)
XSetIMValues (xim, XNDestroyCallback, &destroy, NULL);
#endif
}
}
#else /* not USE_XIM */
else
dpyinfo->xim = NULL;
#endif /* not USE_XIM */
}
......@@ -8123,7 +8127,8 @@ xim_initialize (dpyinfo, resource_name)
struct x_display_info *dpyinfo;
char *resource_name;
{
#ifdef USE_XIM
if (use_xim)
{
#ifdef HAVE_X11R6_XIM
struct xim_inst_t *xim_inst;
int len;
......@@ -8146,9 +8151,9 @@ xim_initialize (dpyinfo, resource_name)
xim_open_dpy (dpyinfo, resource_name);
#endif /* not HAVE_X11R6_XIM */
#else /* not USE_XIM */
}
else
dpyinfo->xim = NULL;
#endif /* not USE_XIM */
}
......@@ -8158,7 +8163,8 @@ static void
xim_close_dpy (dpyinfo)
struct x_display_info *dpyinfo;
{
#ifdef USE_XIM
if (use_xim)
{
#ifdef HAVE_X11R6_XIM
if (dpyinfo->display)
XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb,
......@@ -8169,7 +8175,7 @@ xim_close_dpy (dpyinfo)
XCloseIM (dpyinfo->xim);
dpyinfo->xim = NULL;
XFree (dpyinfo->xim_styles);
#endif /* USE_XIM */
}
}
#endif /* not HAVE_X11R6_XIM */
......@@ -10537,6 +10543,18 @@ x_term_init (display_name, xrm_option, resource_name)
XSynchronize (dpyinfo->display, True);
}
{
Lisp_Object value;
value = display_x_get_resource (dpyinfo,
build_string ("useXIM"),
build_string ("UseXIM"),
Qnil, Qnil);
if (STRINGP (value)
&& (!strcmp (XSTRING (value)->data, "false")
|| !strcmp (XSTRING (value)->data, "off")))
use_xim = 0;
}
UNBLOCK_INPUT;
return dpyinfo;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment