[Uim] Die, .uim file, die!

Jun Inoue jun.lambda at gmail.com
Thu Apr 20 18:46:57 EEST 2006


Dave M G <martin at autotelic.com> writes:

>> Now, supposing that that did the job, to fix the script, the whole
>> thing should be enclosed in if ![ -d "$HOME/.uim.d" ] - fi.
> Hmm... I tried this, but it seemed to revert back to creating the .uim
> file again. I've included the contents of uim_anthy at the end of this
> message, so if I have the syntax wrong, perhaps you could correct me.

There's a corrected version at the end of this message.  But see the
next paragraph.


> But I can't help but wonder... since leaving this uim_anthy file empty
> seems to make my Japanese input settings work exactly as I intend, is
> there any reason I should have this file at all or attempt to edit it?
> Is there a disadvantage to leaving it blank, or deleting it?

For your environment, that would be perfectly fine.  I just didn't
want to advise that as a general solution to this problem, since the
script may have some significance I'm not aware of (note the script
isn't an upstream thing, it's written by the Debian maintainer).  It's
more likely that the script is plain outdated and needs fixing,
though.  I know the package maintainer has been really busy with his
job lately.


>>  Very
>> likely uim-prime, uim-canna and friends have the same defect.
>>
> I don't have either of these files, if that makes any difference. I
> have a scim-prime file, and nothing that says anything about canna.

Then you don't have to worry about them.


> I don't know
> how the Debian/Ubuntu relationship works

I don't either :p


> In fact, I'm not
> even sure what is the bug here. Is it the presence of the file? Its
> syntax?

I would say it's the content of the file.  The maintainer will correct
me if I'm wrong when I post a report.


Corrected version:
XIM=uim
XIM_PROGRAM=/usr/bin/uim-xim
XIM_ARGS=
GTK_IM_MODULE=uim
ENGINE=anthy

if ! [ -d "$HOME/.uim.d" ]; then
  if [ -r "$HOME/.uim" ]; then
    TMPFILE=$(mktemp) || exit 1
    if [ "$(grep "; IM-SWITCH VALUE" $HOME/.uim)" ]; then
      sed "s/(define default-im-name '[^)]*) ; IM-SWITCH VALUE/(define default-im-name '$ENGINE) ; IM-SWITCH VALUE/" < $HOME/.uim > $TMPFILE
    else
      cat $HOME/.uim > $TMPFILE
      if [ "$(grep -E "^\(define[[:space:]]+default-im-name[[:space:]]" $HOME/.uim)" ]; then
        echo "; (define default-im-name '$ENGINE) ; IM-SWITCH VALUE" >> $TMPFILE
      else
        echo "(define default-im-name '$ENGINE) ; IM-SWITCH VALUE" >> $TMPFILE
      fi
    fi
    mv $TMPFILE $HOME/.uim
  else
    echo "(define default-im-name '$ENGINE) ; IM-SWITCH VALUE" > $HOME/.uim
  fi
fi



More information about the uim mailing list