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

Re: lighten my darkness - vim 60ah Win95 dosbox and UNIX vim -d color selection

Expand Messages
  • Walter Briscoe
    In article of Thu, 31 May 2001 18:44:16 in !vim-dev, Bram Moolenaar writes ... See the
    Message 1 of 7 , Jun 1, 2001
    • 0 Attachment
      In article <200105311644.f4VGiGT45101@...> of Thu, 31 May 2001
      18:44:16 in !vim-dev, Bram Moolenaar <Bram@...> writes
      >
      >Walter Briscoe wrote:
      >
      >> I run vim on both Windows 95 and UNIX (AIX) with fairly similar environments
      >> in both. I find the colors for vim -d acceptable in Windows and unacceptable
      >> in UNIX. When I look at the relevant highlight groups, I find:
      >>
      >> Windows 95:
      >> vim -e -u NONE clears the screen before writing "Entering Ex mode ..."
      >> In UNIX, it does not clear the screen. I merely note this. It was not what I
      >> intended to show.
      >
      >Which version of Vim on Window 95? The MS-DOS version doesn't switch screens.
      >The Win32 version does, but it doesn't run that well in a Win95 console.

      See the attachment for version information. BTW. --version does not
      write to stdout and, so, is not redirectable to a file. I guess it
      writes to stderr.
      [ Section: 1/1 File: t.t UUencoded by: Turnpike Integrated Version 5.00 S ]

      begin 644 t.t
      M0SI<=V9B7%9)35QV:6TV,&%H7&-O;&]R<SX@=FEM("UE("UU($Y/3D4@+2UV
      M97)S:6]N("UX/F$Z="YT#0I624T@+2!6:2!)37!R;W9E9"`V+C!A:"!!3%!(
      M02`H,C`P,2!-87D@,C<L(&-O;7!I;&5D($UA>2`R.2`R,#`Q(#`X.C4T.C`S
      M*0T*35,M5VEN9&]W<R`S,B!B:70@8V]N<V]L92!V97)S:6]N#0I":6<@=F5R
      M<VEO;B!W:71H;W5T($=522X@($9E871U<F5S(&EN8VQU9&5D("@K*2!O<B!N
      M;W0@*"TI.@T**V%U=&]C;60@+6)A;&QO;VY?979A;"`M8G)O=W-E("LK8G5I
      M;'1I;E]T97)M<R`K8GET95]O9F9S970@*V-I;F1E;G0-"BMC;61L:6YE7V-O
      M;7!L("MC;61L:6YE7VAI<W0@*V-M9&QI;F5?:6YF;R`K8V]M;65N=',@*V-R
      M>7!T=B`M8W-C;W!E#0HK9&EA;&]G7V-O;B`K9&EF9B`K9&EG<F%P:',@+65B
      M8V1I8R`K96UA8W-?=&%G<R`K979A;"`K97A?97AT<F$@*V5X=')A7W-E87)C
      M:`T**V9A<G-I("MF:6QE7VEN7W!A=&@@+6]S9FEL971Y<&4@*V9I;F1?:6Y?
      M<&%T:"`K9F]L9&EN9R`M9F]O=&5R("MG971T97AT#0HM:&%N9W5L7VEN<'5T
      M("MI;G-E<G1?97AP86YD("MJ=6UP;&ES="`K:V5Y;6%P("ML86YG;6%P("ML
      M:6)C86QL("ML:6YE8G)E86L-"BML:7-P:6YD96YT("ML:7-T8VUD<R`K;&]C
      M86QM87`@*VME>6UA<"`K;65N=2`K;6MS97-S:6]N("MM;V1I9GE?9FYA;64@
      M*VUO=7-E#0HM;6]U<V5S:&%P92`K;75L=&E?8GET92`K;75L=&E?;&%N9R`K
      M<&%T:%]E>'1R82`M<&5R;"`K<')I;G1E<B`M<'ET:&]N#0HK<75I8VMF:7@@
      M*W)I9VAT;&5F="`M<G5B>2`K<V-R;VQL8FEN9"`K<VEG;G,@*W-M87)T:6YD
      M96YT("US;FEF9B`K<W1A='5S;&EN90T*+7-U;E]W;W)K<VAO<"`K<WEN=&%X
      M("MT86=?8FEN87)Y("MT86=?;VQD7W-T871I8R`M=&%G7V%N>5]W:&ET92`M
      M=&-L("UT9V5T96YT#0HM=&5R;7)E<W!O;G-E("MT97AT;V)J96-T<R`K=&ET
      M;&4@+71O;VQB87(@*W5S97)?8V]M;6%N9',@*W9E<G1S<&QI=`T**W9I<G1U
      M86QE9&ET("MV:7-U86P@*W9I<W5A;&5X=')A("MV:6UI;F9O("MW:6QD:6=N
      M;W)E("MW:6QD;65N=2`K=VEN9&]W<PT**W=R:71E8F%C:W5P("UX9F]N='-E
      M="`M>&EM("UX=&5R;5]S879E#0H@("!S>7-T96T@=FEM<F,@9FEL93H@(B16
      M24U<=FEM<F,B#0H@("`@('5S97(@=FEM<F,@9FEL93H@(B1(3TU%7%]V:6UR
      M8R(-"B`R;F0@=7-E<B!V:6UR8R!F:6QE.B`B)%9)35Q?=FEM<F,B#0H@("`@
      M("!U<V5R(&5X<F,@9FEL93H@(B1(3TU%7%]E>')C(@T*("`R;F0@=7-E<B!E
      M>')C(&9I;&4Z("(D5DE-7%]E>')C(@T*0V]M<&EL871I;VXZ(&-L("UC("]7
      M,R`O;F]L;V=O("U$5TE.,S(@("U$7U=)3C,R("U)+B`M27!R;W1O("U$2$%6
      M15]0051(1$5&("U$5TD-"DXS,B`@("`M1$Y$14)51R`O3W@@+UII("U$1%E.
      M04U)0U])0T].5B`M1$193D%-24-?1T545$585`T*3&EN:VEN9SH@;&EN:R`O
      M9&5B=6<@+U)%3$5!4T4@+VYO;&]G;R`O<W5B<WES=&5M.F-O;G-O;&4@+VEN
      M8W)E;65N=&%L.FYO("]N;V1E9F$-"G5L=&QI8CIL:6)C(&%D=F%P:3,R+FQI
      M8B!S:&5L;#,R+FQI8B!G9&DS,BYL:6(@8V]M9&QG,S(N;&EB("!L:6)C+FQI
      M8B`@('5S97(S,BYL#0II8B`@("`@("`O4$1".BY<3V)J0R]#.EQW9F)<5DE-
      47'9I;38P86A<8V]L;W)S/@T*#0H`
      `
      end

      sum -r/size 11202/2282 section (from "begin" to "end")
      sum -r/size 42709/1640 entire input file

      >
      >> Highlight group setting uses color names;
      >> Highlight group reading uses color numbers.
      >> Why the difference?
      >
      >Vim can transform a color name into a color number, but this is guessing,
      >since you can change the colors in various ways (with X resources, for
      >example). The transformation in the other direction isn't reliable for this
      >reason, thus it's not done. Also, when using an xterm with 88 or 256 colors,
      >many numbers don't have a name.
      Then, I would be happier with a number and a name if available. If the
      mapping of names to numbers is many to one, pick the first. Where is
      this coded?

      >
      >> I find that the code is inferring a light background on UNIX.
      >> My ~/.vimrc contains a set background=dark
      >> I infer the .vimrc processing is done after the inbuilt highlight groups
      >> are set. That works REALLY badly for me.
      >
      >If you set the background to dark, Vim should use colors for a dark
      >background. It works for me. I don't know why it wouldn't work. Once Vim
      >has started, is 'background' still dark?
      >
      Yes! The following is on AIX. I suppose I should include version data. I
      do so! That confirms that --version is written to stderr.

      08:45:57 05 /u/t150drs: vim --version 2>| t.t

      08:46:10 05 /u/t150drs: vim --version
      VIM - Vi IMproved 6.0ah ALPHA (2001 May 27, compiled May 30 2001
      08:26:10)
      Compiled by t150drs@iade05a2
      Normal version without GUI. Features included (+) or not (-):
      +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
      [snipped stuff unlikely to be of immediate interest]
      Compilation:
      c89 -c -I. -Iproto -DHAVE_CONFIG_H -D_ALL_SOURCE -O -qmaxmem=32768
      Linking: c89 -L/usr/local/lib -o vim -lcurses
      08:48:13 05 /u/t150drs:

      08:36:55 05 /u/t150drs: vim -e
      Entering Ex mode. Type "visual" to go to Normal mode.
      :hi DiffAdd|hi DiffChange|hi DiffDelete|hi DiffText|set background?

      DiffAdd xxx term=bold ctermbg=4
      DiffChange xxx term=bold ctermbg=5
      DiffDelete xxx term=bold cterm=bold ctermfg=4 ctermbg=6
      DiffText xxx term=reverse cterm=bold ctermbg=1
      background=dark
      :x
      08:39:06 05 /u/t150drs:

      My hypothesis is that the sequence of operations is:
      1) Erroneously set background=light
      2) set Diff* highlights based on that background
      3) Process ~/.vimrc during which we set background=dark
      4) Continue with highlights inconsistent with background

      It seems friendly to demonstrate that those color codes are mappings of
      the color names for light backgrounds specified in src/syntax.c. The
      relevant light data is
      09:11:53 05 vim/bld/vim60ah/src: sed -n '5754p;5772,5774p' syntax.c
      "DiffText term=reverse cterm=bold ctermbg=Red gui=bold
      guibg=Red",
      "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue",
      "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta",
      "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold
      guifg=Blue guibg=LightCyan",
      09:11:59 05 vim/bld/vim60ah/src:

      Oh! It is easier than I thought. highlight clear will do things for me.
      The following are the highlights for a dark background.

      09:15:48 05 vim/bld/vim60ah/src: sed -n '5754p;5792,5794p' syntax.c
      "DiffText term=reverse cterm=bold ctermbg=Red gui=bold
      guibg=Red",
      "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue",
      "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta",
      "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold
      guifg=Blue guibg=DarkCyan",
      09:16:02 05 vim/bld/vim60ah/src:

      I will focus on DiffAdd to demonstrate
      09:16:02 05 vim/bld/vim60ah/src: vim -e
      Entering Ex mode. Type "visual" to go to Normal mode.
      :set background?
      background=dark
      :hi DiffAdd

      DiffAdd xxx term=bold ctermbg=4
      :" Make highlights consistent with background
      :hi clear
      :hi DiffAdd

      DiffAdd xxx term=bold ctermbg=4
      :set background?
      background=dark
      :set background=light
      :hi clear
      :hi DiffAdd

      DiffAdd xxx term=bold ctermbg=4
      :" Well! That seems to demonstrate my understanding of hi clear and the
      code differ
      :hi clear DiffAdd
      :hi DiffAdd
      :hi DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue
      :hi DiffAdd

      DiffAdd xxx term=bold ctermbg=4
      :hi clear DiffAdd
      :hi DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue
      :hi DiffAdd

      DiffAdd xxx term=bold ctermbg=4
      :x
      09:32:55 05 vim/bld/vim60ah/src:

      That makes more sense. vim maps LightBlue to 4 and also maps DarkBlue to
      4. At this point, I am up to my neck and can only ask for a lifebelt!
      No! One more try:
      09:39:21 05 vim/bld/vim60ah/src: vim -e
      Entering Ex mode. Type "visual" to go to Normal mode.
      :set t_Co?
      t_Co=8
      :set t_Co=16
      :hi DiffAdd

      DiffAdd xxx term=bold ctermbg=4
      :hi clear DiffAdd
      :hi DiffAdd
      :hi DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue
      :hi DiffAdd

      DiffAdd xxx term=bold ctermbg=12
      :hi DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue
      :hi DiffAdd

      DiffAdd xxx term=bold ctermbg=4
      :x
      09:42:51 05 vim/bld/vim60ah/src:

      O.K. Setting t_Co=16 causes LightBlue and DarkBlue to be distinguished.
      However, I seem to only have 8 background colours on the telnet client
      which actually drives my screen.
      I have hacked in a hi DiffAdd with ctermbg=Black which deals with the
      immediate concern.
      --
      Walter Briscoe
    • Bram Moolenaar
      ... 32 bit MS-DOS, that s compiled with DJGPP. I think there was a problem of this version clearing the screen when starting up. I m not sure if this can be
      Message 2 of 7 , Jun 1, 2001
      • 0 Attachment
        Walter Briscoe wrote:

        > See the attachment for version information.

        32 bit MS-DOS, that's compiled with DJGPP. I think there was a problem of
        this version clearing the screen when starting up. I'm not sure if this can
        be avoided when starting in Ex mode. I'll put this in the todo list.

        > BTW. --version does not write to stdout and, so, is not redirectable to a
        > file. I guess it writes to stderr.

        Yes, you need to redirect stderr.

        > >Vim can transform a color name into a color number, but this is guessing,
        > >since you can change the colors in various ways (with X resources, for
        > >example). The transformation in the other direction isn't reliable for this
        > >reason, thus it's not done. Also, when using an xterm with 88 or 256 colors,
        > >many numbers don't have a name.
        > Then, I would be happier with a number and a name if available. If the
        > mapping of names to numbers is many to one, pick the first. Where is
        > this coded?

        Showing both a number and the most probably color name? Would be useful.
        This is in the highlight_list_one() function.

        [long text of experiments removed]

        > O.K. Setting t_Co=16 causes LightBlue and DarkBlue to be distinguished.
        > However, I seem to only have 8 background colours on the telnet client
        > which actually drives my screen.
        > I have hacked in a hi DiffAdd with ctermbg=Black which deals with the
        > immediate concern.

        I'm not sure if I understand all of this. Was the conclusion that Vim wasn't
        wrong, but the problem was caused by light and dark blue being the same color?

        --
        hundred-and-one symptoms of being an internet addict:
        64. The remote to the T.V. is missing...and you don't even care.

        /// 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 ///
      • Walter Briscoe
        In article of Fri, 1 Jun 2001 13:02:47 in !vim-dev, Bram Moolenaar writes ... As W9X shells do
        Message 3 of 7 , Jun 1, 2001
        • 0 Attachment
          In article <200106011102.f51B2ld06082@...> of Fri, 1 Jun 2001
          13:02:47 in !vim-dev, Bram Moolenaar <Bram@...> writes
          >
          >Walter Briscoe wrote:
          >
          >> See the attachment for version information.
          >
          >32 bit MS-DOS, that's compiled with DJGPP. I think there was a problem of
          >this version clearing the screen when starting up. I'm not sure if this can
          >be avoided when starting in Ex mode. I'll put this in the todo list.
          >
          >> BTW. --version does not write to stdout and, so, is not redirectable to a
          >> file. I guess it writes to stderr.
          >
          >Yes, you need to redirect stderr.
          As W9X shells do not provide the ability to redirect stderr, I suggest
          the ports to those "operating systems" should write --version output to
          stdout. The same does not apply to NTX where the shell is cmd. However,
          I think it would do no harm in that case.

          >
          >> >Vim can transform a color name into a color number, but this is guessing,
          >> >since you can change the colors in various ways (with X resources, for
          >> >example). The transformation in the other direction isn't reliable for this
          >> >reason, thus it's not done. Also, when using an xterm with 88 or 256 colors,
          >> >many numbers don't have a name.
          >> Then, I would be happier with a number and a name if available. If the
          >> mapping of names to numbers is many to one, pick the first. Where is
          >> this coded?
          >
          >Showing both a number and the most probably color name? Would be useful.
          >This is in the highlight_list_one() function.
          >
          >[long text of experiments removed]
          >
          >> O.K. Setting t_Co=16 causes LightBlue and DarkBlue to be distinguished.
          >> However, I seem to only have 8 background colours on the telnet client
          >> which actually drives my screen.
          >> I have hacked in a hi DiffAdd with ctermbg=Black which deals with the
          >> immediate concern.
          >
          >I'm not sure if I understand all of this. Was the conclusion that Vim wasn't
          >wrong, but the problem was caused by light and dark blue being the same color?
          >
          Yes! That is the conclusion.
          --
          Walter Briscoe
        • Bram Moolenaar
          ... You can redirect stderr in theory. Command.com can t though. It s not easy to send the message to stdout, because the :version command uses the same
          Message 4 of 7 , Jun 1, 2001
          • 0 Attachment
            Walter Briscoe wrote:

            > >> BTW. --version does not write to stdout and, so, is not redirectable to a
            > >> file. I guess it writes to stderr.
            > >
            > >Yes, you need to redirect stderr.
            > As W9X shells do not provide the ability to redirect stderr, I suggest
            > the ports to those "operating systems" should write --version output to
            > stdout. The same does not apply to NTX where the shell is cmd. However,
            > I think it would do no harm in that case.

            You can redirect stderr in theory. Command.com can't though.

            It's not easy to send the message to stdout, because the ":version" command
            uses the same code.

            --
            hundred-and-one symptoms of being an internet addict:
            68. Your cat always puts viruses on your dogs homepage

            /// 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 ///
          Your message has been successfully submitted and would be delivered to recipients shortly.