Subject: bug#14351: 24.3; Using XIM with UIM

From: Stefan Kangas <[email-masked]>
Date: Thu, 24 Nov 2022 17:47:10 -0800

Reuben Thomas <[email-masked]> writes:

> I have been using Emacs happily for some time with XIM out of the box. I
> am using a GTK build of Emacs (as standard in Ubuntu) and had
> GTK_IM_MODULE=xim set in my environment.
>
> Recently, I switched to using UIM, as this allows me to get two bits of
> functionality I rely on: first, ~/.XCompose combinations (via XIM) and
> secondly, Ctrl+Shift+U to enter Unicode code points (this latter doesn’t
> matter to Emacs, of course).
>
> This works fine with every other program I can find, whether GTK, Qt or
> plain X.
>
> In Emacs I tried using uim.el (as shipped with Ubuntu), but this seems
> only to offer one uim input method, ascii-direct-uim, which doesn't seem
> to alter anything.
>
> If I run Emacs normally, XIM has stopped working, and pressing Compose
> just gives me "Multi_key undefined".
>
> I can make XIM work OK again by running Emacs from a bash script which
> goes:
>
> #!/bin/bash
>
> # Work with emacs binary anywhere else on PATH
> path_remove ()  {
>     export PATH=`echo -n $PATH | awk -v RS=: -v ORS=: '$0 != "'$1'"' | sed 's/:$//'`;
> }
> path_remove `dirname $0`
>
> XMODIFIERS=@im=local exec -a $0 emacs "$@"
>
> I tried running
>
> emacs --xrm "emacs.useXIM:true"
>
> but this didn't help (and looking at the source, that's no surprise: my
> Emacs is built with XIM support, so it's only turn-offable, not
> turn-onable).
>
> Is there a simpler way to get this result?

This bug was reported nearly 10 years ago, but unfortunately never got a
reply at the time.

Is this still an issue with a modern version of Emacs?