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

Re: Printing patch - user selectable encodings.

Expand Messages
  • Mikolaj Machowski
    On Mon, Feb 03, 2003 at 12:55:49PM -0000, Mike Williams wrote: Content-Description: Mail message body ... Everything works :) One small thing. Add this line to
    Message 1 of 20 , Feb 3, 2003
    • 0 Attachment
      On Mon, Feb 03, 2003 at 12:55:49PM -0000, Mike Williams wrote:
      Content-Description: Mail message body
      > Hi,
      > New set of patches based on feedback so far:
      > 1) Fixed compilation failures when compiling without multi-byte
      > support (slapped wrist),
      > 2) Report failure to find PS resource file,
      > 3) Correct name of default encoding file on DOS/WIN/OS2 to cp1250
      > (please delete file print/cp1252),
      > 4) Minor corrections and additions to docs.
      > Still against 6.1p312.

      Everything works :)

      One small thing. Add this line to vim.vim syntax file to highlight new
      option's name:

      syn keyword vimOption contained printencoding penc

      And here is collection of encoding vector files:
      print2.zip/print
      cp1250 - East Europe MS encoding
      iso-8859-1 - propably redundant but I am not sure if Vim takes care
      about this value (translates it into latin1 before proceeding)
      iso-8899-3
      iso-8899-4
      iso-8899-5 - Cyrillic
      iso-8899-7 - Greek
      iso-8899-9
      iso-8899-10
      iso-8899-11 - Thai
      iso-8899-13
      iso-8899-14
      iso-8899-15 - West Europe encoding (euro sign)
      koi8-r - Russian cyrillic

      Mikolaj
    • Mikolaj Machowski
      ... Sorry, I forgot about attachement... m.
      Message 2 of 20 , Feb 3, 2003
      • 0 Attachment
        On Mon, Feb 03, 2003 at 09:49:41PM +0100, Mikolaj Machowski wrote:
        > Everything works :)
        > One small thing. Add this line to vim.vim syntax file to highlight new
        > option's name:
        > syn keyword vimOption contained printencoding penc
        > And here is collection of encoding vector files:
        > print2.zip/print
        > cp1250 - East Europe MS encoding
        > iso-8859-1 - propably redundant but I am not sure if Vim takes care
        > about this value (translates it into latin1 before proceeding)
        > iso-8899-3
        > iso-8899-4
        > iso-8899-5 - Cyrillic
        > iso-8899-7 - Greek
        > iso-8899-9
        > iso-8899-10
        > iso-8899-11 - Thai
        > iso-8899-13
        > iso-8899-14
        > iso-8899-15 - West Europe encoding (euro sign)
        > koi8-r - Russian cyrillic
        > Mikolaj

        Sorry, I forgot about attachement...

        m.
      • Mike Williams
        Thanks - I ll start checking them this week. Since the plan is to name the encoding files using the values for encoding that VIM uses (as returned by :set
        Message 3 of 20 , Feb 4, 2003
        • 0 Attachment
          Thanks - I'll start checking them this week.

          Since the plan is to name the encoding files using the values for
          'encoding' that VIM uses (as returned by :set encoding), the file for
          iso-8859-1 is called latin1. This is a slight inconsistency since
          all other values of latinx are converted to iso-8859-x - ho hum.

          The downside is if you compile VIM without multi-byte support,
          'printencoding' does not get converted to a standard name, so if you
          set it to latin2 VIM looks for a latin2 encoding file and will fail.
          I'll add something to the documentation about this.

          I thought about supporting a mapping file that mapped from
          alternative encoding names to a single file, but that feels like
          duplicating information already within VIM. Perhaps the solution is
          to have the encoding name translation in mbyte.c build when PS
          printing is enabled.

          TTFN

          On 3 Feb 2003 at 22:37, Mikolaj Machowski wrote:

          > On Mon, Feb 03, 2003 at 09:49:41PM +0100, Mikolaj Machowski wrote:
          > > Everything works :)
          > > One small thing. Add this line to vim.vim syntax file to highlight new
          > > option's name:
          > > syn keyword vimOption contained printencoding penc
          > > And here is collection of encoding vector files:
          > > print2.zip/print
          > > cp1250 - East Europe MS encoding
          > > iso-8859-1 - propably redundant but I am not sure if Vim takes care
          > > about this value (translates it into latin1 before proceeding)
          > > iso-8899-3
          > > iso-8899-4
          > > iso-8899-5 - Cyrillic
          > > iso-8899-7 - Greek
          > > iso-8899-9
          > > iso-8899-10
          > > iso-8899-11 - Thai
          > > iso-8899-13
          > > iso-8899-14
          > > iso-8899-15 - West Europe encoding (euro sign)
          > > koi8-r - Russian cyrillic
          > > Mikolaj
          >
          > Sorry, I forgot about attachement...
          >
          > m.
          >

          Mike
          --
          Actual newspaper headline: Juvenile Court to Try Shooting Defendant
        • Bram Moolenaar
          ... Well, latin1 is a special value, since it s the default and might actually be used for any 8-bit encoding if you don t care to set encoding . Of course
          Message 4 of 20 , Feb 4, 2003
          • 0 Attachment
            Mike Williams wrote:

            > Since the plan is to name the encoding files using the values for
            > 'encoding' that VIM uses (as returned by :set encoding), the file for
            > iso-8859-1 is called latin1. This is a slight inconsistency since
            > all other values of latinx are converted to iso-8859-x - ho hum.

            Well, "latin1" is a special value, since it's the default and might
            actually be used for any 8-bit encoding if you don't care to set
            'encoding'. Of course it has nothing to do with me writing text in
            latin1 all the time. :-)

            > The downside is if you compile VIM without multi-byte support,
            > 'printencoding' does not get converted to a standard name, so if you
            > set it to latin2 VIM looks for a latin2 encoding file and will fail.
            > I'll add something to the documentation about this.
            >
            > I thought about supporting a mapping file that mapped from
            > alternative encoding names to a single file, but that feels like
            > duplicating information already within VIM. Perhaps the solution is
            > to have the encoding name translation in mbyte.c build when PS
            > printing is enabled.

            If the printing code needs the enc_canonize() function, it can probably
            be made to be included without multi-byte support. Just change a few
            #ifdefs. enc_canonize() is also used for 8-bit encoding names, thus
            it's not multi-byte-only.

            - Bram

            --
            hundred-and-one symptoms of being an internet addict:
            122. You ask if the Netaholics Anonymous t-shirt you ordered can be
            sent to you via e-mail.

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
            \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
            \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
          • Mike Williams
            ... Fair enough, I ll have a stab at it this week. It would certainly make the use of printencoding consistent across types of build. Mike -- I m writing a
            Message 5 of 20 , Feb 5, 2003
            • 0 Attachment
              On 4 Feb 2003 at 23:15, Bram Moolenaar wrote:

              > If the printing code needs the enc_canonize() function, it can probably
              > be made to be included without multi-byte support. Just change a few
              > #ifdefs. enc_canonize() is also used for 8-bit encoding names, thus
              > it's not multi-byte-only.

              Fair enough, I'll have a stab at it this week. It would certainly
              make the use of printencoding consistent across types of build.

              Mike
              --
              I'm writing a book. I've got the page numbers done.
            • Mike Williams
              Patch version #3 (hopefully on the home straight now ;-) ... enc_canonize() et al now included when building with PostScript but not multi-byte. Doc for
              Message 6 of 20 , Feb 6, 2003
              • 0 Attachment
                Patch version #3 (hopefully on the home straight now ;-)

                On 4 Feb 2003 at 23:15, Bram Moolenaar wrote:

                > If the printing code needs the enc_canonize() function, it can probably
                > be made to be included without multi-byte support. Just change a few
                > #ifdefs. enc_canonize() is also used for 8-bit encoding names, thus
                > it's not multi-byte-only.

                enc_canonize() et al now included when building with PostScript but
                not multi-byte. Doc for 'printencoding' has also been updated in
                line.

                I have also removed setting a default encoding for DOS (and updated
                the doc). Ideally this would be cp850 (ah, the good ol' days) and I
                don't have an encoding for it yet. Does anyone actually use hardcopy
                on DOS?

                There is also new encoding files for iso-8859-3, -4 and cp1250.

                And there is also a patch (untested) to update Makefile for
                installing the new runtime files. If someone can test it and see if
                there are any problems I would appreciate it.

                As before, patch is against 6.1p312.

                TTFN

                Mike
                --
                You are not really successful until someone claims they sat beside you in
                school.
              • Mike Williams
                Patch v#4 - sigh. This looks like a good one now. The only changes from the last one are a more complete set of encodings - iso and Windows code pages - except
                Message 7 of 20 , Feb 9, 2003
                • 0 Attachment
                  Patch v#4 - sigh.

                  This looks like a good one now.

                  The only changes from the last one are a more complete set of
                  encodings - iso and Windows code pages - except for Arabic. Once
                  Arabic support is in I will post files for cp1256 and iso-8859-6.
                  There is also koi8-r and koi8-u. There is now a default encoding for
                  HPUX as well. In total there are 26 files so I don't promise there
                  are no mistakes.

                  Also, since the encodings are now user extensible I have renamed the
                  default Mac, VMS, and EBCDIC encoding files to be more
                  standard/specific and to avoid possible clashes, and updated the code
                  and documentation with the new names. Finally, I have reviewed all
                  the encodings, and have made some small changes to make them
                  consistent and bring them more in to line with what copies of the
                  various references I could lay my hands on.

                  I suggest that if there are no problems with the source patches that
                  any changes needed to the encoding files be done as subsequent
                  patches, otherwise I could be posting large patches for a while yet.

                  Still against 6.1p312. Blow away any previous vimruntime/print
                  directories you have please.

                  TTFN

                  Mike
                • Mikolaj Machowski
                  On Sun, Feb 09, 2003 at 07:01:02PM -0000, Mike Williams wrote: Content-Description: Mail message body ... It looks nice for me. Another idea, not so important
                  Message 8 of 20 , Feb 10, 2003
                  • 0 Attachment
                    On Sun, Feb 09, 2003 at 07:01:02PM -0000, Mike Williams wrote:
                    Content-Description: Mail message body
                    > Patch v#4 - sigh.
                    > This looks like a good one now.

                    It looks nice for me.

                    Another idea, not so important as printing but still...

                    line 2834 in ex_cmds2.c:
                    sprintf((char *)tbuf, "Page %d", pagenum);

                    "Page" is hardcoded in source. Since there is i18n of printing it would
                    be nice to see language versions for this :)

                    m.
                  • Mike Williams
                    Ok, I ll look into this to - at a first glance looks like we might want to have alternate default printheader values depending on whether FEAT_STL_OPT is
                    Message 9 of 20 , Feb 11, 2003
                    • 0 Attachment
                      Ok, I'll look into this to - at a first glance looks like we might
                      want to have alternate default 'printheader' values depending on
                      whether FEAT_STL_OPT is defind or not. Or should it just be made a
                      customisable string a la _("Page")?

                      TTFN

                      On 10 Feb 2003 at 13:00, Mikolaj Machowski wrote:

                      > On Sun, Feb 09, 2003 at 07:01:02PM -0000, Mike Williams wrote:
                      > Content-Description: Mail message body
                      > > Patch v#4 - sigh.
                      > > This looks like a good one now.
                      >
                      > It looks nice for me.
                      >
                      > Another idea, not so important as printing but still...
                      >
                      > line 2834 in ex_cmds2.c:
                      > sprintf((char *)tbuf, "Page %d", pagenum);
                      >
                      > "Page" is hardcoded in source. Since there is i18n of printing it would
                      > be nice to see language versions for this :)
                      >
                      > m.

                      Mike
                      --
                      My inferiority complex isn't as good as yours.
                    • Bram Moolenaar
                      ... Using _( Page %d ) should be sufficient. If someone really wants a page header in a language different from the messages he can use printheader . Oh, but
                      Message 10 of 20 , Feb 11, 2003
                      • 0 Attachment
                        Mike Williams wrote:

                        > Ok, I'll look into this to - at a first glance looks like we might
                        > want to have alternate default 'printheader' values depending on
                        > whether FEAT_STL_OPT is defind or not. Or should it just be made a
                        > customisable string a la _("Page")?

                        Using _("Page %d") should be sufficient. If someone really wants a page
                        header in a language different from the messages he can use
                        'printheader'.

                        Oh, but the default 'printheader' also includes "Page", thus we should
                        put N_() around that. Hmm, that's actually not working yet. Same for
                        'titleold', thus that's a bug.

                        --
                        hundred-and-one symptoms of being an internet addict:
                        194. Your business cards contain your e-mail and home page address.

                        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
                      • Mike Williams
                        ... Is there any point supplying you with a patch when it is so small and you already know what to do? ;-) Mike -- Damnation: A beaver colony.
                        Message 11 of 20 , Feb 12, 2003
                        • 0 Attachment
                          On 11 Feb 2003 at 11:12, Bram Moolenaar wrote:

                          > > Ok, I'll look into this to - at a first glance looks like we might
                          > > want to have alternate default 'printheader' values depending on
                          > > whether FEAT_STL_OPT is defind or not. Or should it just be made a
                          > > customisable string a la _("Page")?
                          >
                          > Using _("Page %d") should be sufficient. If someone really wants a page
                          > header in a language different from the messages he can use
                          > 'printheader'.
                          >
                          > Oh, but the default 'printheader' also includes "Page", thus we should
                          > put N_() around that. Hmm, that's actually not working yet. Same for
                          > 'titleold', thus that's a bug.

                          Is there any point supplying you with a patch when it is so small and
                          you already know what to do? ;-)

                          Mike
                          --
                          Damnation: A beaver colony.
                        • Bram Moolenaar
                          ... Actually, small patches are always good. Shows me how it s done and might remind me of a relevant issue. For a big patch that does a global change it s
                          Message 12 of 20 , Feb 12, 2003
                          • 0 Attachment
                            Mike Williams wrote:

                            > On 11 Feb 2003 at 11:12, Bram Moolenaar wrote:
                            >
                            > > > Ok, I'll look into this to - at a first glance looks like we might
                            > > > want to have alternate default 'printheader' values depending on
                            > > > whether FEAT_STL_OPT is defind or not. Or should it just be made a
                            > > > customisable string a la _("Page")?
                            > >
                            > > Using _("Page %d") should be sufficient. If someone really wants a page
                            > > header in a language different from the messages he can use
                            > > 'printheader'.
                            > >
                            > > Oh, but the default 'printheader' also includes "Page", thus we should
                            > > put N_() around that. Hmm, that's actually not working yet. Same for
                            > > 'titleold', thus that's a bug.
                            >
                            > Is there any point supplying you with a patch when it is so small and
                            > you already know what to do? ;-)

                            Actually, small patches are always good. Shows me how it's done and
                            might remind me of a relevant issue. For a big patch that does a global
                            change it's sometimes better to explain what it changes. That's easier
                            to understand.

                            --
                            $ echo pizza > /dev/oven

                            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                            /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                            \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                            \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
                          • Mike Williams
                            ... One small patch, as requested. Done against 6.1p320 ... *************** *** 1558,1564 **** { printheader , pheader , P_STRING|P_VI_DEF, #ifdef
                            Message 13 of 20 , Feb 14, 2003
                            • 0 Attachment
                              On 12 Feb 2003 at 11:29, Bram Moolenaar wrote:

                              > Actually, small patches are always good. Shows me how it's done and
                              > might remind me of a relevant issue. For a big patch that does a global
                              > change it's sometimes better to explain what it changes. That's easier
                              > to understand.

                              One small patch, as requested. Done against 6.1p320

                              *** option.c.orig Mon Jan 20 10:07:07 2003
                              --- option.c Fri Feb 14 09:39:47 2003
                              ***************
                              *** 1558,1564 ****
                              {"printheader", "pheader", P_STRING|P_VI_DEF,
                              #ifdef FEAT_PRINTER
                              (char_u *)&p_header, PV_NONE,
                              ! {(char_u *)"%<%f%h%m%=Page %N", (char_u *)0L}
                              #else
                              (char_u *)NULL, PV_NONE,
                              {(char_u *)NULL, (char_u *)0L}
                              --- 1558,1564 ----
                              {"printheader", "pheader", P_STRING|P_VI_DEF,
                              #ifdef FEAT_PRINTER
                              (char_u *)&p_header, PV_NONE,
                              ! {(char_u *)N_("%<%f%h%m%=Page %N"), (char_u *)0L}
                              #else
                              (char_u *)NULL, PV_NONE,
                              {(char_u *)NULL, (char_u *)0L}
                              *** ex_cmds2.c.orig Tue Feb 11 21:16:14 2003
                              --- ex_cmds2.c Fri Feb 14 09:40:01 2003
                              ***************
                              *** 2841,2847 ****
                              }
                              else
                              #endif
                              ! sprintf((char *)tbuf, "Page %d", pagenum);

                              prt_set_fg(COLOR_BLACK);
                              prt_set_bg(COLOR_WHITE);
                              --- 2841,2847 ----
                              }
                              else
                              #endif
                              ! sprintf((char *)tbuf, _("Page %d"), pagenum);

                              prt_set_fg(COLOR_BLACK);
                              prt_set_bg(COLOR_WHITE);


                              Mike
                              --
                              Into each life some rain must fall - usually on the weekends.
                            • Bram Moolenaar
                              ... Thanks, I ll include it. Still need to find a way to get default option values translated... -- You can tune a file system, but you can t tuna fish -- man
                              Message 14 of 20 , Feb 14, 2003
                              • 0 Attachment
                                Mike Williams wrote:

                                > On 12 Feb 2003 at 11:29, Bram Moolenaar wrote:
                                >
                                > > Actually, small patches are always good. Shows me how it's done and
                                > > might remind me of a relevant issue. For a big patch that does a global
                                > > change it's sometimes better to explain what it changes. That's easier
                                > > to understand.
                                >
                                > One small patch, as requested. Done against 6.1p320

                                Thanks, I'll include it.

                                Still need to find a way to get default option values translated...

                                --
                                You can tune a file system, but you can't tuna fish
                                -- man tunefs

                                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                                /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                                \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                                \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
                              Your message has been successfully submitted and would be delivered to recipients shortly.