exim

Homepage: https://github.com/ch11ng/exim

Author: Chris Feng

Updated:

Summary

Emacs X Input Method

Commentary

EXIM (Emacs X Input Method) is an X input method server utilizing Emacs as
its backend. It's mainly designed for working with EXWM window manger.
Considering that Emacs ships with a bunch of builtin input methods (in LEIM)
and it's easy to make new ones for it, EXIM can support a large variety of
input methods.

Note that this is not the only input method working in EXWM; perhaps other
IM servers also work. This just provides an alternative.

The XIM protocol is quite flexible by itself, stating that an implementation
can create network connections of various types as well as make use of an
existing X connection for communication, and that an IM server may support
multiple transport versions, various input styles and several event flow
modals, etc. Here we only make choices that are most popular among other
IM servers and more importantly, practical for Emacs to act as a IM server:
+ Packets are transported on top of an X connection, as is adopted by most
  IMEs.
+ Only transport version 0.0 (i.e. only-CM & Property-with-CM) is supported
  (same as "IM Server Developers Kit", which is used by most IMEs).
+ Only support static event flow, on-demand-synchronous method.
+ Only "root-window" input style is supported.

To enable EXIM for EXWM, follow these steps:
0. Install exwm first.
1. Save EXIM to your disk and make sure it's in `load-path'.
2. Add following lines to your Emacs init file:

   (require 'exim)
   (add-hook 'exwm-init-hook 'exim-start)

3. Bind a key to toggle input method. Typically you should choose 'C-\'.
4. Insert following lines to '~/.xinitrc':

   export XMODIFIERS=@im=exim
   export GTK_IM_MODULE=xim
   export QT_IM_MODULE=xim
   export CLUTTER_IM_MODULE=xim


Todo:
+ Exploit input-method-[de]activate-hook to reduce unnecessary traffic.
+ Are strings NULL-terminated? (UIM)
+ Some requests should be handled synchronously.

References:
+ XIM (http://www.x.org/releases/X11R7.6/doc/libX11/specs/XIM/xim.html)
+ IMdkit (http://xorg.freedesktop.org/archive/unsupported/lib/IMdkit/)
+ UIM (https://github.com/uim/uim)

Dependencies