Document LANG and XMODIFIERS in case of XCreateIC failure
authorNelson Ferreira <nelson.ferreira@ieee.org>
Sun, 7 Jun 2015 20:08:57 +0000 (16:08 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Sun, 7 Jun 2015 20:10:47 +0000 (16:10 -0400)
 * src/mule/input-method-xlib: Add xim_warn2 macro.

 * src/mule/input-method-xlib(XIM_init_frame): Get and output to
      stderr the value of LANG and XMODIFIERS to help
      troubleshooting.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/mule/input-method-xlib.c

index 0f7bd38..e522627 100644 (file)
@@ -85,9 +85,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 #endif
 
 Lisp_Object Qxim_xlib;
-#define xim_warn(str) warn_when_safe (Qxim_xlib, Qwarning, str);
-#define xim_warn1(fmt, str) warn_when_safe (Qxim_xlib, Qwarning, fmt, str);
-#define xim_info(str) warn_when_safe (Qxim_xlib, Qinfo, str);
+#define xim_warn(str) warn_when_safe (Qxim_xlib, Qwarning, str)
+#define xim_warn1(fmt, str) warn_when_safe (Qxim_xlib, Qwarning, fmt, str)
+#define xim_warn2(fmt, str1, str2) \
+  warn_when_safe (Qxim_xlib, Qwarning, fmt, str1, str2)
+#define xim_info(str) warn_when_safe (Qxim_xlib, Qinfo, str)
 
 #ifdef XIM_XLIB /* XIM_XLIB specific */
 /* Get/Set IC values for just one attribute */
@@ -394,7 +396,10 @@ XIM_init_frame (struct frame *f)
        XFree (s_list);
 
        if (!xic) {
-               xim_warn ("Warning: XCreateIC failed.\n");
+               char *lang = getenv("LANG");
+               char *xmodifiers = getenv("XMODIFIERS");
+               xim_warn2 ("Warning: XCreateIC failed. LANG='%s' XMODIFIERS='%s'\n",
+                          (lang?lang:""), (xmodifiers?xmodifiers:""));
                return;
        }