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

Switching XIM on and off

Expand Messages
  • Bram Moolenaar
    In Vim 6.0w the :lmap or language maps are used in Insert mode and other places where text is typed. For example when entering a search string. For the
    Message 1 of 14 , Mar 5, 2001
    View Source
    • 0 Attachment
      In Vim 6.0w the ":lmap" or language maps are used in Insert mode and other
      places where text is typed. For example when entering a search string.

      For the Win32 IME there is code to automatically switch the input method
      between English mode and Origin mode. I wonder why that isn't done for XIM.

      Should we automatically enable XIM in Insert mode and disable it in Normal
      mode? That sounds logical, since Vim commands are English letters.

      The CTRL-^ command that is used to switch the ":lmap" language maps on/off
      is remembered for Insert mode. Thus if you exit Insert mode with <Esc> and
      start it again with "i", then the last state of using the language maps is
      restored. That could be used for XIM too (although I don't know how to obtain
      the current on/off state of the XIM).

      --
      hundred-and-one symptoms of being an internet addict:
      60. As your car crashes through the guardrail on a mountain road, your first
      instinct is to search for the "back" button.

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    • Nam SungHyun
      ... You mean xim_set_focus() in multibyte.c? XIM is enabled in Insert mode and disabled in Normal mode. But, to allow f or F (and t T ...) with
      Message 2 of 14 , Mar 5, 2001
      View Source
      • 0 Attachment
        Bram Moolenaar wrote:
        >
        > In Vim 6.0w the ":lmap" or language maps are used in Insert mode and other
        > places where text is typed. For example when entering a search string.
        >
        > For the Win32 IME there is code to automatically switch the input method
        > between English mode and Origin mode. I wonder why that isn't done for XIM.
        >
        > Should we automatically enable XIM in Insert mode and disable it in Normal
        > mode? That sounds logical, since Vim commands are English letters.

        You mean 'xim_set_focus()' in multibyte.c?
        XIM is enabled in Insert mode and disabled in Normal mode.

        But, to allow 'f' or 'F' (and 't' 'T' ...) with multibyte,
        I made gvim always connect to XIM if input_style is OverTheSpot.
        only OverTheSpot. gvim only enable the XIM in insert mode if the
        input_method is not OverTheSpot.

        I'd never used 'f' with multibyte. For consistency, it may good to
        remove the input_style check codes in xim_set_focus().


        While in insert mode (XIM on), I (Korean) can switch english and origin mode
        using Shift-Space or Han/Eng key. Han/Eng key is a key that selects input
        language (toggle). But many people use Shift-Space, it's easy than using
        Han/Eng key. Windows also support Shift-Space (with Han/Eng key).

        > The CTRL-^ command that is used to switch the ":lmap" language maps
        > on/off is remembered for Insert mode. Thus if you exit Insert mode
        > with <Esc> and start it again with "i", then the last state of using
        > the language maps is restored. That could be used for XIM too
        > (although I don't know how to obtain the current on/off state of the
        > XIM).

        namsh
      • Bram Moolenaar
        ... I only see xim_set_focus() being called when the GUI window obtains keyboard focus or when it looses keyboard focus. I don t see it being called when Vim
        Message 3 of 14 , Mar 6, 2001
        View Source
        • 0 Attachment
          Sung-Hyun Nam wrote:

          > Bram Moolenaar wrote:
          > >
          > > In Vim 6.0w the ":lmap" or language maps are used in Insert mode and other
          > > places where text is typed. For example when entering a search string.
          > >
          > > For the Win32 IME there is code to automatically switch the input method
          > > between English mode and Origin mode. I wonder why that isn't done for
          > > XIM.
          > >
          > > Should we automatically enable XIM in Insert mode and disable it in Normal
          > > mode? That sounds logical, since Vim commands are English letters.
          >
          > You mean 'xim_set_focus()' in multibyte.c?
          > XIM is enabled in Insert mode and disabled in Normal mode.

          I only see xim_set_focus() being called when the GUI window obtains keyboard
          focus or when it looses keyboard focus. I don't see it being called when Vim
          goes from Normal to Insert mode.

          > But, to allow 'f' or 'F' (and 't' 'T' ...) with multibyte,
          > I made gvim always connect to XIM if input_style is OverTheSpot.
          > only OverTheSpot. gvim only enable the XIM in insert mode if the
          > input_method is not OverTheSpot.
          >
          > I'd never used 'f' with multibyte. For consistency, it may good to
          > remove the input_style check codes in xim_set_focus().

          I don't see where the connection is between getting the argument for a "f"
          command and the XIM code. There is a call to ImeSetOriginMode() for the Win32
          IME. Search in normal.c. This is the same place where ":lmap" mappings are
          used.

          > While in insert mode (XIM on), I (Korean) can switch english and origin mode
          > using Shift-Space or Han/Eng key. Han/Eng key is a key that selects input
          > language (toggle). But many people use Shift-Space, it's easy than using
          > Han/Eng key. Windows also support Shift-Space (with Han/Eng key).

          I understand you can switch the mode of the XIM manually. Wouldn't it be far
          more convenient if Vim automatically switches the mode to English when leaving
          Insert mode? And restore the previous state when going to Insert mode again?

          --
          Ed's Radiator Shop: The Best Place in Town to Take a Leak.

          /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
          ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
          \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
        • Nam SungHyun
          ... xim_set_preedit() calls xim_set_focus() also. and xim_set_preedit() is called when VIM update cursor. check gui_update_cursor() in gui.c I meant, to allow
          Message 4 of 14 , Mar 6, 2001
          View Source
          • 0 Attachment
            Bram Moolenaar wrote:
            >
            > Sung-Hyun Nam wrote:
            >
            > > Bram Moolenaar wrote:
            > > >
            > > > In Vim 6.0w the ":lmap" or language maps are used in Insert mode
            > > > and other places where text is typed. For example when entering a
            > > > search string.
            > > >
            > > > For the Win32 IME there is code to automatically switch the input
            > > > method between English mode and Origin mode. I wonder why that
            > > > isn't done for XIM.
            > > >
            > > > Should we automatically enable XIM in Insert mode and disable it
            > > > in Normal mode? That sounds logical, since Vim commands are
            > > > English letters.
            > >
            > > You mean 'xim_set_focus()' in multibyte.c?
            > > XIM is enabled in Insert mode and disabled in Normal mode.
            >
            > I only see xim_set_focus() being called when the GUI window obtains
            > keyboard focus or when it looses keyboard focus. I don't see it being
            > called when Vim goes from Normal to Insert mode.
            >
            > > But, to allow 'f' or 'F' (and 't' 'T' ...) with multibyte,
            > > I made gvim always connect to XIM if input_style is OverTheSpot.
            > > only OverTheSpot. gvim only enable the XIM in insert mode if the
            > > input_method is not OverTheSpot.
            > >
            > > I'd never used 'f' with multibyte. For consistency, it may good to
            > > remove the input_style check codes in xim_set_focus().
            >
            > I don't see where the connection is between getting the argument for a
            > "f" command and the XIM code. There is a call to ImeSetOriginMode()
            > for the Win32 IME. Search in normal.c. This is the same place where
            > ":lmap" mappings are used.

            xim_set_preedit() calls xim_set_focus() also.
            and xim_set_preedit() is called when VIM update cursor.
            check gui_update_cursor() in gui.c

            I meant, to allow 'f' with multibyte,
            if the input_style is OverTheSpot, vim always connect to XIM even in
            Normal mode. So, using OverTheSpot, if MB is multibyte, I can find
            MB by:

            f<Shift+Space>MB<Shift-Space>
            ------------ ------------
            | |
            | + IM send the 'MB' to vim and enters English mode
            + IM enters hangul mode

            terminal-vim always connect to IM. As you know terminal don't know
            vi's Normal or Insert mode. So, I thought it is good if gvim works
            same as terminal-vim.

            > > While in insert mode (XIM on), I (Korean) can switch english and
            > > origin mode using Shift-Space or Han/Eng key. Han/Eng key is a key
            > > that selects input language (toggle). But many people use
            > > Shift-Space, it's easy than using Han/Eng key. Windows also support
            > > Shift-Space (with Han/Eng key).
            >
            > I understand you can switch the mode of the XIM manually. Wouldn't it
            > be far more convenient if Vim automatically switches the mode to
            > English when leaving Insert mode? And restore the previous state when
            > going to Insert mode again?

            my XIM supports vi-hack mode. I mean, if it detect <ESC>
            in hangul insert mode, it changes to English mode automatically.
            it's optional. And I always enable that feature.

            And I made a patch. How about it?
            Now, terminal-vim and gvim has a different behavior with this patch.

            edit.c: if VIM goes to Normal mode, disable XIM.
            multibyte.c: disable XIM if current mode is Normal (OverTheSpot)

            regards,

            namsh

            diff -u -p -u -p -r1.15.2.2 edit.c
            --- ./edit.c 2 Mar 2001 02:15:42 -0000 1.15.2.2
            +++ ./edit.c 6 Mar 2001 13:52:22 -0000
            @@ -5229,6 +5229,9 @@ ins_esc(count, cmdchar)
            /* GIME_TEST */
            ImeSetEnglishMode();
            #endif
            +#if defined(FEAT_XIM)
            + xim_set_focus(FALSE);
            +#endif

            #if defined(FEAT_HANGULIN)
            # if defined(ESC_CHG_TO_ENG_MODE)
            diff -u -p -u -p -r1.9.2.1 multibyte.c
            --- ./multibyte.c 2 Mar 2001 02:15:42 -0000 1.9.2.1
            +++ ./multibyte.c 6 Mar 2001 13:20:35 -0000
            @@ -2051,15 +2051,7 @@ xim_set_focus(int focus)

            if (focus)
            {
            - /* In Normal mode, only connect to IM if user uses over-the-spot. */
            - if (!xim_has_focus
            - && (!(State & NORMAL)
            -#ifdef FEAT_GUI_GTK
            - || (xim_input_style & GDK_IM_PREEDIT_POSITION)
            -#else
            - || (input_style & XIMPreeditPosition)
            -#endif
            - ))
            + if (!xim_has_focus && !(State & NORMAL))
            {
            xim_has_focus = 1;
            #ifdef FEAT_GUI_GTK
          • Chong-Dae Park
            ... How about to make it an vim run-time option (such as always_connect_xim ) or compile-time directive(XIM_HACK?)? -- Chong-Dae Park -- The Ultimate Question
            Message 5 of 14 , Mar 6, 2001
            View Source
            • 0 Attachment
              On Wed, Mar 07, 2001 at 03:07:42PM +0900, Nam SungHyun wrote:
              > And I made a patch. How about it?
              > Now, terminal-vim and gvim has a different behavior with this patch.

              How about to make it an vim run-time option (such as "always_connect_xim")
              or compile-time directive(XIM_HACK?)?

              --
              Chong-Dae Park
              --
              The Ultimate Question is....
              W.H.A.T.D.O.Y.O.U.G.E.T.I.F.Y.O.U.M.U.L.T.I.P.L.Y.S.I.X.B.Y.N.I.N.E.....
              - "The Restaurant at the End of the Universe", D. Adams -
            • Bram Moolenaar
              ... I can see gui_update_cursor() calling xim_set_preedit(). But it then calls xim_set_focus(TRUE), thus always enabling the XIM, unless in Normal mode and
              Message 6 of 14 , Mar 7, 2001
              View Source
              • 0 Attachment
                Sung-Hyun Nam wrote:

                > > I don't see where the connection is between getting the argument for a
                > > "f" command and the XIM code. There is a call to ImeSetOriginMode()
                > > for the Win32 IME. Search in normal.c. This is the same place where
                > > ":lmap" mappings are used.
                >
                > xim_set_preedit() calls xim_set_focus() also.
                > and xim_set_preedit() is called when VIM update cursor.
                > check gui_update_cursor() in gui.c

                I can see gui_update_cursor() calling xim_set_preedit(). But it then calls
                xim_set_focus(TRUE), thus always enabling the XIM, unless in Normal mode and
                not using over-the-spot.

                > I meant, to allow 'f' with multibyte,
                > if the input_style is OverTheSpot, vim always connect to XIM even in
                > Normal mode. So, using OverTheSpot, if MB is multibyte, I can find
                > MB by:
                >
                > f<Shift+Space>MB<Shift-Space>
                > ------------ ------------
                > | |
                > | + IM send the 'MB' to vim and enters English mode
                > + IM enters hangul mode
                >
                > terminal-vim always connect to IM. As you know terminal don't know
                > vi's Normal or Insert mode. So, I thought it is good if gvim works
                > same as terminal-vim.

                What I don't understand is why this depends on the type of input method. When
                using another method, you still want to type the same characters, right?
                Or does over-the-spot mean that you can type English characters directly?

                > my XIM supports vi-hack mode. I mean, if it detect <ESC>
                > in hangul insert mode, it changes to English mode automatically.
                > it's optional. And I always enable that feature.

                I don't like hacks like this, because it means a specific XIM is required.
                Independency is preferred.

                > And I made a patch. How about it?
                > Now, terminal-vim and gvim has a different behavior with this patch.
                >
                > edit.c: if VIM goes to Normal mode, disable XIM.
                > multibyte.c: disable XIM if current mode is Normal (OverTheSpot)

                That the GUI and the console work differently is to be expected, since for the
                GUI Vim takes care of the input method, while in a console it's the console
                that does this.

                Wouldn't it be better if xim_set_preedit() doesn't call xim_set_focus()?
                Instead we would call xim_set_focus() in the same places where the ":lmap"
                mappings are enabled, to switch between English and language characters.

                Otherwise, perhaps we need to set a global variable "xim_wanted" that
                specifies the language mode. Not some side effect of changing "State", which
                is indirect and may have other side effects. Then xim_set_focus() can use
                "xim_wanted" to check if the XIM should be activated or not.

                --
                >From "know your smileys":
                (X0||) Double hamburger with lettuce and tomato

                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
                \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
              • Nam SungHyun
                ... Windows and Unix is different. I have no knowledge (especially Windows). Next is just my experience. Windows: First of all, VIM always connect to IME.
                Message 7 of 14 , Mar 7, 2001
                View Source
                • 0 Attachment
                  Bram Moolenaar wrote:
                  >
                  > Wouldn't it be better if xim_set_preedit() doesn't call xim_set_focus()?
                  > Instead we would call xim_set_focus() in the same places where the ":lmap"
                  > mappings are enabled, to switch between English and language characters.

                  Windows and Unix is different. I have no knowledge (especially Windows).
                  Next is just my experience.

                  Windows: First of all, VIM always connect to IME.

                  While input english, it acts like OverTheSpot(or OnTheSPot).
                  While input multibyte, it acts like OffTheSpot, but somewhat
                  different to XIM. IME send a ONE multibyte to VIM when composing
                  ends.

                  Unix :
                  Root: VIM got a multibyte word. While input character,
                  character shown in another window that created by
                  XIM.
                  OffTheSpot: VIM got a multibyte word. While input character,
                  character shown in Statue Area. VIM support status
                  area to XIM.
                  OverTheSpot: VIM got a multibyte word. While input character,
                  character shown in VIM's cursor position.
                  OnTheSpot: VIM got a multibyte word. While input character,
                  VIM can draw the character using callback.

                  I believe VIM cannot set 'Native language' or 'English' Mode.
                  VIM only can do 'enable' or 'disable' XIM. and user set language
                  mode manually. Well, in my case, when XIM enabled, it enters to
                  previous language mode. But, I think it's not the same
                  situation in Windows (Origin and English mode).

                  And why VIM got a multibyte word, I guess because there can
                  be conversion occured. Hangul-Word <--> Chinese Word.
                  (Or maybe Katagana-Word <--> Hiragana-Word <--> Chinese-Word)...
                  In windows, user may convert ONE by ONE?
                  Well, it's not normal in Korea. Most of us use Hangul only.
                  But specific case, user input Hangul, and can convert it to
                  Chinese.

                  Like windows, OverTheSpot and OnTheSpot can always connect to XIM, I think.
                  There's no difference when user inputs English (OverTheSpot/OnTheSpot).
                  But, OffTheSpot and Root, it's painful to input English (the character
                  shown area).

                  I hope it clears issues.

                  regards,

                  namsh
                • Nam SungHyun
                  ... I made a mistake. Correct above line to: While input multibyte, it acts like Root, but somewhat ... namsh
                  Message 8 of 14 , Mar 7, 2001
                  View Source
                  • 0 Attachment
                    namsh wrote:
                    > Bram Moolenaar wrote:
                    > >
                    > > Wouldn't it be better if xim_set_preedit() doesn't call xim_set_focus()?
                    > > Instead we would call xim_set_focus() in the same places where the ":lmap"
                    > > mappings are enabled, to switch between English and language characters.
                    >
                    > Windows and Unix is different. I have no knowledge (especially Windows).
                    > Next is just my experience.
                    >
                    > Windows: First of all, VIM always connect to IME.
                    >
                    > While input english, it acts like OverTheSpot(or OnTheSPot).
                    > While input multibyte, it acts like OffTheSpot, but somewhat

                    I made a mistake. Correct above line to:

                    While input multibyte, it acts like Root, but somewhat

                    > different to XIM. IME send a ONE multibyte to VIM when composing
                    > ends.
                    >
                    > Unix :
                    > Root: VIM got a multibyte word. While input character,
                    > character shown in another window that created by
                    > XIM.
                    > OffTheSpot: VIM got a multibyte word. While input character,
                    > character shown in Statue Area. VIM support status
                    > area to XIM.
                    > OverTheSpot: VIM got a multibyte word. While input character,
                    > character shown in VIM's cursor position.
                    > OnTheSpot: VIM got a multibyte word. While input character,
                    > VIM can draw the character using callback.
                    >
                    > I believe VIM cannot set 'Native language' or 'English' Mode.
                    > VIM only can do 'enable' or 'disable' XIM. and user set language
                    > mode manually. Well, in my case, when XIM enabled, it enters to
                    > previous language mode. But, I think it's not the same
                    > situation in Windows (Origin and English mode).
                    >
                    > And why VIM got a multibyte word, I guess because there can
                    > be conversion occured. Hangul-Word <--> Chinese Word.
                    > (Or maybe Katagana-Word <--> Hiragana-Word <--> Chinese-Word)...
                    > In windows, user may convert ONE by ONE?
                    > Well, it's not normal in Korea. Most of us use Hangul only.
                    > But specific case, user input Hangul, and can convert it to
                    > Chinese.
                    >
                    > Like windows, OverTheSpot and OnTheSpot can always connect to XIM, I think.
                    > There's no difference when user inputs English (OverTheSpot/OnTheSpot).
                    > But, OffTheSpot and Root, it's painful to input English (the character
                    > shown area).
                    >
                    > I hope it clears issues.
                    >
                    > regards,
                    >
                    > namsh

                    namsh
                  • Bram Moolenaar
                    ... OK, so for English mode the IME is still used. ... [...] ... When the XIM is disabled, this means you can type English, right? Thus isn t switching the
                    Message 9 of 14 , Mar 8, 2001
                    View Source
                    • 0 Attachment
                      Sung-Hyun Nam wrote:

                      > Bram Moolenaar wrote:
                      > >
                      > > Wouldn't it be better if xim_set_preedit() doesn't call xim_set_focus()?
                      > > Instead we would call xim_set_focus() in the same places where the ":lmap"
                      > > mappings are enabled, to switch between English and language characters.
                      >
                      > Windows and Unix is different. I have no knowledge (especially Windows).
                      > Next is just my experience.
                      >
                      > Windows: First of all, VIM always connect to IME.
                      >
                      > While input english, it acts like OverTheSpot(or OnTheSPot).
                      > While input multibyte, it acts like OffTheSpot, but somewhat
                      > different to XIM. IME send a ONE multibyte to VIM when composing
                      > ends.

                      OK, so for English mode the IME is still used.

                      > Unix :
                      [...]
                      > I believe VIM cannot set 'Native language' or 'English' Mode.
                      > VIM only can do 'enable' or 'disable' XIM. and user set language
                      > mode manually. Well, in my case, when XIM enabled, it enters to
                      > previous language mode. But, I think it's not the same
                      > situation in Windows (Origin and English mode).

                      When the XIM is disabled, this means you can type English, right? Thus isn't
                      switching the XIM on/off nearly equal to switching between English and
                      language mode?

                      --
                      hundred-and-one symptoms of being an internet addict:
                      92. It takes you two hours to check all 14 of your mailboxes.

                      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                      ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
                      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                    • Nam SungHyun
                      ... When the XIM is disabled, VIM got a character from the X(?). When the XIM is enabled, user can select language mode. And XIM handle user input and send a
                      Message 10 of 14 , Mar 8, 2001
                      View Source
                      • 0 Attachment
                        Bram Moolenaar wrote:
                        >
                        > Sung-Hyun Nam wrote:
                        >
                        > > Unix :
                        > [...]
                        > > I believe VIM cannot set 'Native language' or 'English' Mode.
                        > > VIM only can do 'enable' or 'disable' XIM. and user set language
                        > > mode manually. Well, in my case, when XIM enabled, it enters to
                        > > previous language mode. But, I think it's not the same
                        > > situation in Windows (Origin and English mode).
                        >
                        > When the XIM is disabled, this means you can type English, right?
                        > Thus isn't switching the XIM on/off nearly equal to switching between
                        > English and language mode?

                        When the XIM is disabled, VIM got a character from the X(?).
                        When the XIM is enabled, user can select language mode.
                        And XIM handle user input and send a character to VIM both english
                        character or native language.
                        Because english character does not need to compose, XIM send the
                        character immediately.

                        regards,

                        namsh
                      • Bram Moolenaar
                        ... Let s use an example: You are inserting Korean characters, thus XIM is set to your language mode. Then you hit and you want to type some Normal mode
                        Message 11 of 14 , Mar 8, 2001
                        View Source
                        • 0 Attachment
                          Sung-Hyun Nam wrote:

                          > > > Unix :
                          > > [...]
                          > > > I believe VIM cannot set 'Native language' or 'English' Mode.
                          > > > VIM only can do 'enable' or 'disable' XIM. and user set language
                          > > > mode manually. Well, in my case, when XIM enabled, it enters to
                          > > > previous language mode. But, I think it's not the same
                          > > > situation in Windows (Origin and English mode).
                          > >
                          > > When the XIM is disabled, this means you can type English, right?
                          > > Thus isn't switching the XIM on/off nearly equal to switching between
                          > > English and language mode?
                          >
                          > When the XIM is disabled, VIM got a character from the X(?).
                          > When the XIM is enabled, user can select language mode.
                          > And XIM handle user input and send a character to VIM both english
                          > character or native language.
                          > Because english character does not need to compose, XIM send the
                          > character immediately.

                          Let's use an example: You are inserting Korean characters, thus XIM is set to
                          your language mode. Then you hit <Esc> and you want to type some Normal mode
                          command, like "j". Currently, the user has to first switch the XIM mode to
                          English, right? That is an extra action the user has to do.

                          My idea was that when Vim switches from Insert mode to Normal mode, the XIM
                          would be disabled, thus the typed characters are obtained directly, and you
                          don't need to switch language mode in the XIM. When you enter Insert mode
                          again, the XIM would be enabled and you are back in your language mode
                          automatically.

                          Thus the idea is to avoid the need to have the user manually switch his XIM
                          between English and language mode.

                          --
                          hundred-and-one symptoms of being an internet addict:
                          95. Only communication in your household is through email.

                          /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                          ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
                          \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                        • Nam SungHyun
                          ... Yes. Terminal+xim+vim user should do that. ... So, you will apply my patch (at least edit.c patch), right? :) And then, gvim user has a benefit than
                          Message 12 of 14 , Mar 8, 2001
                          View Source
                          • 0 Attachment
                            Bram Moolenaar wrote:
                            >
                            > Sung-Hyun Nam wrote:
                            >
                            > > > > Unix :
                            > > > [...]
                            > > > > I believe VIM cannot set 'Native language' or 'English' Mode.
                            > > > > VIM only can do 'enable' or 'disable' XIM. and user set language
                            > > > > mode manually. Well, in my case, when XIM enabled, it enters to
                            > > > > previous language mode. But, I think it's not the same
                            > > > > situation in Windows (Origin and English mode).
                            > > >
                            > > > When the XIM is disabled, this means you can type English, right?
                            > > > Thus isn't switching the XIM on/off nearly equal to switching between
                            > > > English and language mode?
                            > >
                            > > When the XIM is disabled, VIM got a character from the X(?).
                            > > When the XIM is enabled, user can select language mode.
                            > > And XIM handle user input and send a character to VIM both english
                            > > character or native language.
                            > > Because english character does not need to compose, XIM send the
                            > > character immediately.
                            >
                            > Let's use an example: You are inserting Korean characters, thus XIM is
                            > set to your language mode. Then you hit <Esc> and you want to type
                            > some Normal mode command, like "j". Currently, the user has to first
                            > switch the XIM mode to English, right? That is an extra action the
                            > user has to do.

                            Yes. Terminal+xim+vim user should do that.

                            > My idea was that when Vim switches from Insert mode to Normal mode,
                            > the XIM would be disabled, thus the typed characters are obtained
                            > directly, and you don't need to switch language mode in the XIM. When
                            > you enter Insert mode again, the XIM would be enabled and you are back
                            > in your language mode automatically.
                            >
                            > Thus the idea is to avoid the need to have the user manually switch his XIM
                            > between English and language mode.

                            So, you will apply my patch (at least edit.c patch), right? :)
                            And then, gvim user has a benefit than terminal-version.

                            regards,

                            namsh
                          • Chong-Dae Park
                            ... Yes. You are right. But... Many programmers are also feel that this is stupid. And there is a hack. If a user types , XIM changes mode to English
                            Message 13 of 14 , Mar 8, 2001
                            View Source
                            • 0 Attachment
                              On Thu, Mar 08, 2001 at 12:54:37PM +0100, Bram Moolenaar wrote:
                              > Let's use an example: You are inserting Korean characters, thus XIM is set to
                              > your language mode. Then you hit <Esc> and you want to type some Normal mode
                              > command, like "j". Currently, the user has to first switch the XIM mode to
                              > English, right? That is an extra action the user has to do.

                              Yes. You are right.
                              But... Many programmers are also feel that this is stupid.
                              And there is a hack. If a user types <ESC>, XIM changes mode to English
                              automatically.

                              (It makes emacs users unhappy and make patchs that make this behavior
                              optional.)

                              As I know, Windows Input Method does not support it because Windows is not
                              VI-friendly.

                              --
                              Chong-Dae Park
                              -- ' C-language Edition
                              #define cdpark /* TC Lab, Div. of CS, Dept. of EECS, KAIST */
                              #include <signature.h> /* the Hitchhiker's Guide to the Internet?? */
                            • Bram Moolenaar
                              ... Yes, I will now include the switching of XIM on/off. I ll do that for Insert mode, entering a search pattern and for the argument of commands like r and
                              Message 14 of 14 , Mar 8, 2001
                              View Source
                              • 0 Attachment
                                Sung-Hyun Nam wrote:

                                > So, you will apply my patch (at least edit.c patch), right? :)
                                > And then, gvim user has a benefit than terminal-version.

                                Yes, I will now include the switching of XIM on/off. I'll do that for Insert
                                mode, entering a search pattern and for the argument of commands like "r" and
                                "f". Please check in the next version that this works well.

                                --
                                hundred-and-one symptoms of being an internet addict:
                                100. The most exciting sporting events you noticed during summer 1996
                                was Netscape vs. Microsoft.

                                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                                ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
                                \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                              Your message has been successfully submitted and would be delivered to recipients shortly.