Loading ...
Sorry, an error occurred while loading the content.

Re: Vim version 6.0ak ALPHA available [patch]

Expand Messages
  • Nam SungHyun
    ... Only OnTheSpot can detect current language (Using preedit callback). The other method cannot detect current language now. I guess Muraoka mentioned about
    Message 1 of 7 , Jun 20, 2001
    • 0 Attachment
      Bram Moolenaar wrote:
      >
      > Nam SungHyun wrote:
      >
      > > > > > If the 'iminsert' option itself changes value, this probably
      > > > > > happens by im_save_status(). It is called in ins_esc() in
      > > > > > edit.c.
      > > > >
      > > > > I figured out why it happens. im_get_status() should not check
      > > > > 'xim_preediting'. While connecting to XIM, user can change the
      > > > > language (English or Native). In english input mode,
      > > > > 'xim_preediting' is FALSE for OnTheSpot. 'xim_preediting' is
      > > > > always FALSE for other methods (Root, OffTheSpot, OverTheSpot).
      > > > > Currently only OnTheSpot can know current language mode.
      > > >
      > > > I don't quite understand these changes. It mostly looks like
      > > > renaming im_get_status() to im_native_lang_input_mode(). But the
      > > > difference between the im_get_status(), which now only checks
      > > > "xim_has_focus", and im_native_lang_input_mode(), which only uses
      > > > "xim_preediting" escapes me. Why not one function that says
      > > > whether non-English input mode is active? This can be used both
      > > > for 'iminsert', the cursor shape/color and the status line. What
      > > > is the real difference between "xim_preediting" and
      > > > "xim_has_focus"?
      > >
      > > if xim_has_focus == 1, it means vim connect to XIM.
      > >
      > > if xim_preediting == 1, it means the current input language is native.
      > > And vim connect to XIM (xim_has_focus = 1).
      > >
      > > if xim_preediting == 0, it means the current input language is english.
      > > And vim connect to XIM (Insert Mode) or not (Normal mode).
      > >
      > > Previous: im_get_status() always return False for
      > > Root/OffTheSpot/OverTheSpot because 'xim_preeditng' is updated only for
      > > OnTheSpot.
      >
      > Are the above correct when not use OnTheSpot then? It seems that when using
      > one of the other metheds, xim_preediting doesn't matter, thus xim_has_focus
      > has to be used to decide if the user was typing English or not.

      Only OnTheSpot can detect current language (Using preedit callback).
      The other method cannot detect current language now. I guess
      Muraoka mentioned about this before.

      > Something like:
      >
      > im_get_status()
      > {
      > if (using OnTheSpot)
      > return xim_preediting && xim_has_focus;
      > else
      > return xim_has_focus;
      > }
      >
      > Would that work correctly?

      If you don't like my patch, then how about just do

      im_get_status()
      {
      return xim_has_focus;
      }

      Then, at least VIM can always connect to XIM. Though the ColorIM is not
      usable.

      > > And though user use OnTheSpot, if user change input language
      > > to English while connecting XIM, im_get_status() returns False.
      > > So, if user go to Normal mode while in english input mode, VIM saves
      > > imi=0. And after that, VIM does not connect to XIM when user enters
      > > Insert mode.
      >
      > That's correct. This is what was intended that should happen.

      I found ONE more problem. VIM does not connect to XIM when I typed ':'.

      > One problem might be that there is no way to connect to XIM again when already
      > in Insert mode. Perhaps in OnTheSpot method we should always connect to XIM
      > but set it to use English mode when 'iminsert' is zero? I don't know how to
      > do this though.
      >
      > > About im_native_lang_input_mode() (with CursorIM), I think it is not
      > > important to user that VIM uses IM or not. But user want to see current
      > > input language mode via Cursor color.
      >
      > I think it should be consistent. If the cursor color shows using IM
      > then the mode message should do the same.

      There already exists in-consistent. Win32 version always connect to IM
      server. X version does not always connect to XIM. Because of this
      reason, I believe my patch is a good solution at this time.

      I think The problem is VIM try to select language automatically, and
      XIM does not like it.

      Regards,
      namsh
    • Bram Moolenaar
      ... OK, thus the value of xim_preediting is invalid when not use the OnTheSpot method. ... I was trying to find a way to do it correctly in all situations.
      Message 2 of 7 , Jun 21, 2001
      • 0 Attachment
        Nam SungHyun wrote:

        > > Are the above correct when not use OnTheSpot then? It seems that when
        > > using one of the other metheds, xim_preediting doesn't matter, thus
        > > xim_has_focus has to be used to decide if the user was typing English or
        > > not.
        >
        > Only OnTheSpot can detect current language (Using preedit callback).
        > The other method cannot detect current language now. I guess
        > Muraoka mentioned about this before.

        OK, thus the value of xim_preediting is invalid when not use the OnTheSpot
        method.

        > > Something like:
        > >
        > > im_get_status()
        > > {
        > > if (using OnTheSpot)
        > > return xim_preediting && xim_has_focus;
        > > else
        > > return xim_has_focus;
        > > }
        > >
        > > Would that work correctly?
        >
        > If you don't like my patch, then how about just do
        >
        > im_get_status()
        > {
        > return xim_has_focus;
        > }
        >
        > Then, at least VIM can always connect to XIM. Though the ColorIM is not
        > usable.

        I was trying to find a way to do it correctly in all situations. This
        requires that we are able to know whether the OnTheSpot method is being used
        or not. When it is used, we can check the value of xim_preediting. When it
        is not used, we should just use xim_has_focus.

        The next thing to do is find some way to enable XIM from Insert mode when it
        was disabled by 'iminsert' being zero. With CTRL-^ it's possible to switch
        langmap on/off. Perhaps some other command should switch XIM on/off?

        However, when using OnTheSpot, the switching can be done inside XIM. Thus we
        should always connect to XIM and use 'iminsert' to set the mode to English or
        language. This requires being able to detect OnTheSpot method and setting the
        mode.

        > I found ONE more problem. VIM does not connect to XIM when I typed ':'.

        I think that's the same problem as in Insert mode. For a ":" command line you
        are expected to start typing a range and a command name. Thus you always
        start in English mode. But further on you might want to type something in
        your language. Then we need some command to switch XIM on.

        > > I think it should be consistent. If the cursor color shows using IM
        > > then the mode message should do the same.
        >
        > There already exists in-consistent. Win32 version always connect to IM
        > server. X version does not always connect to XIM. Because of this
        > reason, I believe my patch is a good solution at this time.
        >
        > I think The problem is VIM try to select language automatically, and
        > XIM does not like it.

        It's not easy, but hopefully we manage to make it work and make users happy!

        --
        The chat program is in public domain. This is not the GNU public license.
        If it breaks then you get to keep both pieces.
        -- Copyright notice for the chat program

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • Nam SungHyun
        ... It seems you don t understand correctly? If the switching means the language mode, then the other method is same. The switching can be done inside XIM.
        Message 3 of 7 , Jun 21, 2001
        • 0 Attachment
          Bram Moolenaar wrote:
          >
          > Nam SungHyun wrote:
          >
          > > > Are the above correct when not use OnTheSpot then? It seems that when
          > > > using one of the other metheds, xim_preediting doesn't matter, thus
          > > > xim_has_focus has to be used to decide if the user was typing English or
          > > > not.
          > >
          > > Only OnTheSpot can detect current language (Using preedit callback).
          > > The other method cannot detect current language now. I guess
          > > Muraoka mentioned about this before.
          >
          > OK, thus the value of xim_preediting is invalid when not use the OnTheSpot
          > method.
          >
          > > > Something like:
          > > >
          > > > im_get_status()
          > > > {
          > > > if (using OnTheSpot)
          > > > return xim_preediting && xim_has_focus;
          > > > else
          > > > return xim_has_focus;
          > > > }
          > > >
          > > > Would that work correctly?
          > >
          > > If you don't like my patch, then how about just do
          > >
          > > im_get_status()
          > > {
          > > return xim_has_focus;
          > > }
          > >
          > > Then, at least VIM can always connect to XIM. Though the ColorIM is not
          > > usable.
          >
          > I was trying to find a way to do it correctly in all situations. This
          > requires that we are able to know whether the OnTheSpot method is being used
          > or not. When it is used, we can check the value of xim_preediting. When it
          > is not used, we should just use xim_has_focus.
          >
          > The next thing to do is find some way to enable XIM from Insert mode when it
          > was disabled by 'iminsert' being zero. With CTRL-^ it's possible to switch
          > langmap on/off. Perhaps some other command should switch XIM on/off?
          >
          > However, when using OnTheSpot, the switching can be done inside XIM.

          It seems you don't understand correctly?
          If 'the switching' means the language mode, then the other method is
          same. The switching can be done inside XIM. But VIM cannot know the
          language mode for the other method.

          > Thus we should always connect to XIM and use 'iminsert' to set the
          > mode to English or language. This requires being able to detect
          > OnTheSpot method and setting the mode.
          >
          > > I found ONE more problem. VIM does not connect to XIM when I typed ':'.
          >
          > I think that's the same problem as in Insert mode. For a ":" command line you
          > are expected to start typing a range and a command name. Thus you always
          > start in English mode. But further on you might want to type something in
          > your language. Then we need some command to switch XIM on.
          >
          > > > I think it should be consistent. If the cursor color shows using IM
          > > > then the mode message should do the same.

          Because VIM cannot know the language mode for 'the other method',
          I prefer VIM works like as before (VIM 6.0aj) for XIM version.
          How about not define 'USE_IM_CONTROL(?)' for FEAT_XIM?

          > > There already exists in-consistent. Win32 version always connect to IM
          > > server. X version does not always connect to XIM. Because of this
          > > reason, I believe my patch is a good solution at this time.
          > >
          > > I think The problem is VIM try to select language automatically, and
          > > XIM does not like it.
          >
          > It's not easy, but hopefully we manage to make it work and make users happy!

          Regards,
          namsh
        Your message has been successfully submitted and would be delivered to recipients shortly.