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

X11 GUI i18n

Expand Messages
  • Andrew Rodionoff
    I have some thoughts about current state of affairs in X11 Vim i18n. Please tell me if I m wrong. 1) Vim uses X input method only in multibyte character
    Message 1 of 8 , Feb 10, 2001
    • 0 Attachment
      I have some thoughts about current state of affairs in X11 Vim i18n.
      Please tell me if I'm wrong.

      1) Vim uses X input method only in multibyte character locale. This is not
      good, because there are many systems where character is one byte long, but
      input events are multibyte. Such locales considered `broken' by configure
      script, but that's not true (see attached patch1). BTW, 'guifontset' option is
      not strictly nessessary in this case.

      2) Vim tries some fallbacks when opening IM server, except the one with
      input method set to 'none': (see patch2)

      3) GUI Vim uses 8th bit to recognize Meta-<key> combos. If you are typing
      8-bit text -- you are screwed :( I don't have generic solution yet. For myself
      I stuff <Esc> before a keysym, like it's done in xterms, and set 'esckeys'
      option. (see patch3 and patch4)

      I use Vim 5.7.24, but I guess all of the above applies to 6.x branch too.

      --
      Best regards, Andrew

      I have a TINY BOWL in my HEAD
    • Bram Moolenaar
      ... You have been looking into Vim 5.7. The most recent version is 6.0u. This is an alpha test version, but it includes many changes for the multi-byte code.
      Message 2 of 8 , Feb 10, 2001
      • 0 Attachment
        Andrew Rodionoff wrote:

        > I have some thoughts about current state of affairs in X11 Vim i18n.
        > Please tell me if I'm wrong.

        You have been looking into Vim 5.7. The most recent version is 6.0u. This is
        an alpha test version, but it includes many changes for the multi-byte code.

        > 1) Vim uses X input method only in multibyte character locale. This is not
        > good, because there are many systems where character is one byte long, but
        > input events are multibyte. Such locales considered `broken' by configure
        > script, but that's not true (see attached patch1). BTW, 'guifontset' option
        > is not strictly nessessary in this case.

        This has already changed considerably. Please have a look into how Vim 6.0u
        does this. Perhaps suggest a change relative to that.

        Most of the XIM stuff has been made by Asians. I'm sure that some work needs
        to be done for Russian, Polish, etc. It's very difficult for someone to work
        on code that he will never use himself.

        > 2) Vim tries some fallbacks when opening IM server, except the one with
        > input method set to 'none': (see patch2)

        What does this do?

        > 3) GUI Vim uses 8th bit to recognize Meta-<key> combos. If you are typing
        > 8-bit text -- you are screwed :( I don't have generic solution yet. For
        > myself I stuff <Esc> before a keysym, like it's done in xterms, and set
        > 'esckeys' option. (see patch3 and patch4)

        For people like me, using Meta-c is a good way to enter an 8-bit character.
        We would need a good way to detect that you are typing 8-bit text in some
        other way. How to detect this? If impossible, perhaps this should be an
        option.

        I suggest you wait a couple of days before getting 6.0, because I have just
        been doing quite a bit of work on the multi-byte code. The next version will
        support editing UTF-8 on a normal (latin1) terminal, for example.

        - Bram

        --
        They now pass three KNIGHTS impaled to a tree. With their feet off the
        ground, with one lance through the lot of them, they are skewered up
        like a barbecue.
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// 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 ///
      • Andrew Rodionoff
        Greetings, Bram ... BM This has already changed considerably. Please have a look into how Vim BM 6.0u does this. Perhaps suggest a change relative to that.
        Message 3 of 8 , Feb 12, 2001
        • 0 Attachment
          Greetings, Bram

          On Sat, Feb 10, 2001 at 22:46:19, Bram Moolenaar wrote:

          >> 1) Vim uses X input method only in multibyte character locale. This is
          >> not good, because there are many systems where character is one byte
          >> long, but input events are multibyte. Such locales considered `broken'
          >> by configure script, but that's not true (see attached patch1). BTW,
          >> 'guifontset' option is not strictly nessessary in this case.

          BM> This has already changed considerably. Please have a look into how Vim
          BM> 6.0u does this. Perhaps suggest a change relative to that.
          I'll look into it as soon as I'll grab the next version. As far as I can
          tell now XIM is fully usable without any mbyte or fontset stuff at all. I use
          slightly patched version of 5.7 with fontset and multibyte disabled and have
          no trouble editing 8bit text.

          BM> Most of the XIM stuff has been made by Asians. I'm sure that some work
          BM> needs to be done for Russian, Polish, etc. It's very difficult for
          BM> someone to work on code that he will never use himself.

          >> 2) Vim tries some fallbacks when opening IM server, except the one with
          >> input method set to 'none': (see patch2)

          BM> What does this do?
          This is primarily for poor fellows who have no input method server for
          their language, but who'd like to benefit from using IM. I have a msg from
          Sung-Hyun-Nam who suggests using Xdefaults for this. He is quite right, but I
          think this fallback is reasonable and helps to run XIM out-of-the-box.

          >> 3) GUI Vim uses 8th bit to recognize Meta-<key> combos. If you are
          >> typing 8-bit text -- you are screwed :( I don't have generic solution
          >> yet. For myself I stuff <Esc> before a keysym, like it's done in xterms,
          >> and set 'esckeys' option. (see patch3 and patch4)

          BM> For people like me, using Meta-c is a good way to enter an 8-bit
          BM> character.
          For people like myself Meta-i-i sequence is a good way to insert \item to
          TeX or <item></item> to SGML source :)

          BM> We would need a good way to detect that you are typing 8-bit
          BM> text in some other way. How to detect this? If impossible, perhaps
          BM> this should be an option.
          I guess so. I'll wait for next release and try to make up a more mature
          version of this patch.

          --
          Best regards, Andrew

          I was making donuts and now I'm on a bus!
        • Bram Moolenaar
          ... As far as I can see will Vim 6.0 use the XIM also when not using the multi-byte feature. But you better check if it really works. ... I don t like using
          Message 4 of 8 , Feb 13, 2001
          • 0 Attachment
            Andrew Rodionoff wrote:

            > >> 1) Vim uses X input method only in multibyte character locale. This is
            > >> not good, because there are many systems where character is one byte
            > >> long, but input events are multibyte. Such locales considered `broken'
            > >> by configure script, but that's not true (see attached patch1). BTW,
            > >> 'guifontset' option is not strictly nessessary in this case.
            >
            > BM> This has already changed considerably. Please have a look into how Vim
            > BM> 6.0u does this. Perhaps suggest a change relative to that.
            > I'll look into it as soon as I'll grab the next version. As far as I can
            > tell now XIM is fully usable without any mbyte or fontset stuff at all. I use
            > slightly patched version of 5.7 with fontset and multibyte disabled and have
            > no trouble editing 8bit text.

            As far as I can see will Vim 6.0 use the XIM also when not using the
            multi-byte feature. But you better check if it really works.

            > BM> Most of the XIM stuff has been made by Asians. I'm sure that some work
            > BM> needs to be done for Russian, Polish, etc. It's very difficult for
            > BM> someone to work on code that he will never use himself.
            >
            > >> 2) Vim tries some fallbacks when opening IM server, except the one with
            > >> input method set to 'none': (see patch2)
            >
            > BM> What does this do?
            > This is primarily for poor fellows who have no input method server for
            > their language, but who'd like to benefit from using IM. I have a msg from
            > Sung-Hyun-Nam who suggests using Xdefaults for this. He is quite right, but I
            > think this fallback is reasonable and helps to run XIM out-of-the-box.

            I don't like using Xdefaults myself, they are too complicated for "normal"
            users.

            What I don't understand is what a XIM will do when there is "none"? Isn't
            that the same as not using XIM?

            --
            A vacation is a period of travel during which you find that you
            took twice as many clothes and half as much money as you needed.

            /// 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 ///
          • Andrew Rodionoff
            It appears that Vim compiled with +xim does not need multibyte and fontset features. The patch included works fine for me, allowing to input i18n characters
            Message 5 of 8 , Feb 26, 2001
            • 0 Attachment
              It appears that Vim compiled with +xim does not need multibyte and fontset
              features. The patch included works fine for me, allowing to input i18n
              characters using X11R6 xkb w/o fontset and stuff. I've also included new
              option 'metaesc', aimed to make GUI Vim send <esc> before Meta-modified key,
              like xterm does. This one supposed to solve a problem of entering
              Meta-modified 8bit chars.

              --
              Best regards, Andrew

              I used to be a FUNDAMENTALIST, but then I heard about the HIGH
              RADIATION LEVELS and bought an ENCYCLOPEDIA!!
            • Bram Moolenaar
              ... This makes sense to me. This code was written from the point of view of an Asian, where the fontset is required. But XIM and fontset appear to be mostly
              Message 6 of 8 , Feb 27, 2001
              • 0 Attachment
                Andrew Rodionoff wrote:

                > It appears that Vim compiled with +xim does not need multibyte and fontset
                > features. The patch included works fine for me, allowing to input i18n
                > characters using X11R6 xkb w/o fontset and stuff.

                This makes sense to me. This code was written from the point of view of an
                Asian, where the fontset is required. But XIM and fontset appear to be mostly
                independent of eachother.

                I'll make this change such that when Vim was compiled with the xfontset
                feature but no fontset was specified, it works the same way as not compiling
                with xfontset support. This was mostly the case already. Perhaps I still
                missed a few places though, this should be checked in the next version.

                > I've also included new option 'metaesc', aimed to make GUI Vim send <esc>
                > before Meta-modified key, like xterm does. This one supposed to solve a
                > problem of entering Meta-modified 8bit chars.

                There are a few problems with this:
                - An extra option. Would be better if meta keys work the same way always.
                - Using <M-x> in mappings won't work when 'metaesc' is set.
                - Using an ESC causes trouble in Insert mode, it's not normally used for
                special keys in the GUI.

                It's not clear what problem this option is trying to solve.

                --
                No engineer can take a shower without wondering if some sort of Teflon coating
                would make showering unnecessary.
                (Scott Adams - The Dilbert principle)

                /// 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 ///
              • Andrew Rodionoff
                Greetings, Bram On Tue, Feb 27, 2001 at 14:49:25, Bram Moolenaar wrote: BM Andrew Rodionoff wrote: [...] ... BM There are a few problems with this: BM - An
                Message 7 of 8 , Feb 28, 2001
                • 0 Attachment
                  Greetings, Bram

                  On Tue, Feb 27, 2001 at 14:49:25, Bram Moolenaar wrote:
                  BM> Andrew Rodionoff wrote:
                  [...]
                  >> I've also included new option 'metaesc', aimed to make GUI Vim send
                  >> <esc> before Meta-modified key, like xterm does. This one supposed to
                  >> solve a problem of entering Meta-modified 8bit chars.

                  BM> There are a few problems with this:
                  BM> - An extra option. Would be better if meta keys work the same way always.
                  BM> - Using <M-x> in mappings won't work when 'metaesc' is set.
                  I see your point. I guess the whole meta-key recognition can be rewritten
                  to use <Esc> as a prefix. I know at least one editor that use similar
                  approach, it's John Harper's Jade.

                  BM> - Using an ESC causes trouble in Insert mode, it's not normally used for
                  BM> special keys in the GUI.
                  It's a matter of setting 'esckeys' option. It can be force-set when
                  'metaesc' is being set.

                  BM> It's not clear what problem this option is trying to solve.
                  I guess I speak English like Two Conkers from Discworld Noir do :) It's
                  apparently a problem of i18n. When one is typing 8-bit (I mean 8th bit on)
                  text, he can't use Meta-combos to trigger macros. Meta-modified key and actual
                  keysym just appear to be the same.

                  --
                  Best regards, Andrew

                  He is the MELBA-BEING ... the ANGEL CAKE ... XEROX him ... XEROX him --
                • Bram Moolenaar
                  ... You can t use -char when you want to insert the character with the 8th bit set, like it s done now. You don t want to insert the anyway, thus
                  Message 8 of 8 , Mar 1, 2001
                  • 0 Attachment
                    Andrew Rodionoff wrote:

                    > [...]
                    > >> I've also included new option 'metaesc', aimed to make GUI Vim send
                    > >> <esc> before Meta-modified key, like xterm does. This one supposed to
                    > >> solve a problem of entering Meta-modified 8bit chars.
                    >
                    > BM> There are a few problems with this:
                    > BM> - An extra option. Would be better if meta keys work the same way always.
                    > BM> - Using <M-x> in mappings won't work when 'metaesc' is set.
                    > I see your point. I guess the whole meta-key recognition can be rewritten
                    > to use <Esc> as a prefix. I know at least one editor that use similar
                    > approach, it's John Harper's Jade.

                    You can't use <Esc>-char when you want to insert the character with the 8th
                    bit set, like it's done now. You don't want to insert the <Esc> anyway, thus
                    it would only be for mappings.

                    > BM> - Using an ESC causes trouble in Insert mode, it's not normally used for
                    > BM> special keys in the GUI.
                    > It's a matter of setting 'esckeys' option. It can be force-set when
                    > 'metaesc' is being set.

                    I don't like side effects like this. The GUI uses CSI to avoid this mixup of
                    the <Esc> key and special keys using <Esc>. I want to keep it that way.
                    There already is a special code for prepending a modifier to a character, I
                    don't see why a new mechanism is needed.

                    > BM> It's not clear what problem this option is trying to solve.
                    > I guess I speak English like Two Conkers from Discworld Noir do :) It's
                    > apparently a problem of i18n. When one is typing 8-bit (I mean 8th bit on)
                    > text, he can't use Meta-combos to trigger macros. Meta-modified key and
                    > actual keysym just appear to be the same.

                    You mean that when you have a character for which the 8th bit is already set,
                    the META modifier can't be noticed? Well, that should be solved by putting a
                    META modifer code before the character. It's quite simple to change the code
                    for this. I'm not sure if mappings with <M-x> (where x is a character with
                    the 8th bit set) work right away, please check that in the next version.

                    --
                    Give a man a computer program and you give him a headache,
                    but teach him to program computers and you give him the power
                    to create headaches for others for the rest of his life...
                    R. B. Forest

                    /// 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.