I just wish to share my experience trying to type international characters (European and Chinese mostly) in Xterm, Emacs, and Firefox.
Typing European and Chinese characters in Emacs, xterm, and Firefox worked fine up to 2012 on my 32-bit version of Slackware running XFree86. Of course I had LANG=en_US.UTF-8 as well as LC_CTYPE=en_US.UTF-8.
Unfortunately, after installing Slackware64 and Xorg something was broken and I was never able to have SCIM activate in all those programs. I could no longer type European characters in Emacs. SCIM always activates in Firefox, but sometimes (very rarely) Firefox hanged until I exit SCIM.
I have no deep understanding of how SCIM and Xorg work together, however I found out that the order in which those programs are started is relevant. So, here is my recipe if you will that makes them all work.
Initially, file xorg.conf needs to include the altgr-intl option so the right Alt key can be used as the compose key.
Section "InputDevice"
...
Option "XkbLayout" "us"
Option "XkbVariant" "altgr-intl"
EndSection
Then, to address the problem I had with the deadkeys in Emacs, I needed to add the following line to 'emacs.el' (
ref),
(require 'iso-transl)
Now, to get SCIM to work in xterm, I need to insert the following just at the beginning of the .xinitrc file. I added two lines to remove any remaining scim processes and sockets before starting a new X session.
ps -e | grep scim | while read i _; do a="kill -9 $i"; echo $a; eval "$a"; done
rm -f /tmp/scim*socket*${USER}
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
export XIM_PROGRAM="/usr/bin/scim -d"
/usr/bin/scim -d
That is quite standard. However if I later kill scim and restart then I can no longer use scim in the xterm's!
There is more. I have always been using the fvwm windows manager, and I now have two monitors. I don't use Xinerama though since I use virtual screens and most often the second monitor is off. So I need to set DISPLAY in the .xinitrc script. The curious point is if I set
export DISPLAY=:0.1
before starting scim above, I can't use SCIM in the xterm's so I need to set DISPLAY AFTER starting scim...
That takes care of the xterm.
Finally, to get SCIM to work in Emacs, I installed scim-bridge.el. scim-bridge.el does not work with a pure scim-1.4.15 since there is no scim-bridge program in SCIM since 1.4.14. There is a patch to scim-bridge.el that should make it work with scim-im-agent, but that did not work on my setup. So I ended up installing scim-bridge-0.4.16-x86_64-5 from Slackware-14.0 and using the unpatched scim-bridge.el package. So I end up with all of SCIM-1.4.15 plus scim-bridge from an earlier version of SCIM!
Before even trying to run SCIM in emacs one needs to start Firefox or Thunderbird. Tnen one can safely load scim-mode in emacs.
So 1) start a xterm, 2) start emacs, but don't start scim-mode yet, 3) start Firefox and finally activate scim-mode in emacs. Humm...
At this point I can claim success. I can have xterm's, emacs and Thunderbird/Firefox all accepting either SCIM input or accented letters (by using the compose key -- the right Alt key).
Please feel free to comment.
Note 1. Changing the above order results is SCIM not working in either xterm or emacs.
Note 2. Although the recipe worked fine last night and this morning, I just restarted X11 at the end of the afternoon and now I can no longer connect to SCIM from xterm's. There is some randomness here as if there was a memory leak somewhere.
Note 3. I still got in the situation where scim did not start with X because of leftover scim processes or sockets. So I added two lines to my .xinitrc to remove those 'scim' processes and sockets before starting 'scim'. According to the book, 'scim' should start automatically when pressing Ctrl-;, but that does not seem to be the case with the 'xterms'.