next up previous contents index
Next: More information on the Up: Japanese Input Previous: Starting Wnn



Canna relies on the cannaserver to process the kana into kanji.

After installing Debian-jp 1.2 I had to add the following .emacs and .canna files to my home directory to be able to input in emacs/mule. If you can't read the Japanese comments, just ignore them. You just need the English lisp code. I'll change these into screen captures soon. C-o starts the canna input method in emacs. The space bar converts the hiragana in the fences into kanji.

.emacs file for canna input

     (if (and (boundp 'CANNA) CANNA) 
         (load-library "canna")
         (canna) ))

.canna file for canna input

     (global-unbind-key-function 'japanese-mode)
     (global-set-key "\C-e" 'japanese-mode)

     (global-unbind-key-function 'japanese-mode)
     (global-set-key "\Nfer" 'japanese-mode)
(setq romkana-table "default.cbp")

 :bushu "bushu"
 :user "user"

(set-key 'ichiran-mode "\C-o" '(quit extend))
(set-key 'ichiran-mode "\C-i" '(quit shrink))

  ?[ "「" "『" "[" "[" "〔"
  ?] "」" "』" "]" "]" "〕" )

  ?. "。" "." "."
  ?, "、" "," "," )

canna and kinput2

Thanks to Manuel Chakravarty for contributing this.

   Manuel M. T. Chakravarty
University of Tsukuba, Japan

I assume a standard Linux file system (I use Slackware) and
that `kterm' is installed (you can get it from the file
`packages/xclt/kterm.tgz' in `JE-0.9.8a').

The following installation steps have to be done by *root*:

(1) Get the contents of the directory `packages/canna/' from
    `JE-0.9.8a' and copy them to `/' (root).

(2) Install the package as follows (they contain both Canna
    and `kinput2'):

      cd /
      tar xzf cancbin.tgz
      sh install/ -install
      tar xzf candic.tgz
      sh install/ -install
      tar xzf cansbin.tgz		
      tar xzf ki2can.tgz		
      tar xzf canclt.tgz
      tar xzf canman.tgz		# optional (Japanese man pages)
      tar xzf canprog.tgz		# optional (for programming)
      tar xzf cjvim.tgz			# optional (canna version...)
      sh install/ -install	# optional (...of vi)

(Remark: If you already have `kinput2' installed - and omit
some of the above steps - on your system, be sure you have a
`kinput2' that has support for Canna compiled in. Try to
start it with the `-canna' option, and see if it complains.)

(3) To launch canna at boot time, I added the following to
    my `rc.local' file:

      if [ -f /usr/local/canna/bin/cannaserver ]; then
	  rm -f /var/lock/canna/.CANNALOCK

So much for the actual installation.  Some further
user-local configuration is needed to make everything work.
An alternative would be to modify the corresponding
sytem-wide resources, like a global initialization script
that is run when X windows is started.  I didn't do that,
but I don't see a reason why it shoudn't work.  But now the
user local configuration steps:

(4) Add the following line to your X resources, usually the
    file `.Xdefaults':

      *inputMethod: kinput2

    The man page of `kinput2' advices to add a line like

      export XMODIFIERS="@im=kinput2"  # bash
      setenv XMODIFIERS "@im=kinput2"  # (t)csh

    to your shell resource file, because some programs
    ignore the X resource.  It is definitely not necessary
    for `kterm', but it can't hurt and may help with some
    other software...

(5) To launch `kinput2' when your X windows session is
    started, put the following into your `.xinitrc' file:

      /usr/X11/bin/kinput2 -canna&

    If you run the canna server on a different machine than
    you run your X session, you can tell `kinput2' with the
    option `-cannaserver' followed by the name of the machine
    that hosts the server.

(6) `Kterm's default key for switching between ASCII and
    Kana/kanji input is Ctrl-Kanji.  If you don't have a key
    bound to the key symbol `Kanji', you can easily fix this
    by adding a line

      xmodmap -e 'keycode <some-keycode> = Kanji'

    to your `.xinitrc'.  You have to substitute
    <some-keycode> with the keycode of the key that you want
    to use; you can inquire these codes with the program
    `xev', which should be part of your X distribution.

    (I think, I read somewhere that Shift-Space also works -
    it *doesn't* work on my machine.)

Test it by starting a `kterm' (after rebooting your machine,
of course; Canna adds a new TCP service) and pressing


A small window with a hiragana `a' should appear, and
disappear if you press the same key combination again.

Finally, you can check the status of the canna server by


After `kinput2' is started, the above command should list it
as a client of Canna.

Craig Toshio Oda