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

Re[2]: Strange behaviour of :compiler/:make/tidy

Expand Messages
  • dionn@tomtom.com
    ... Basically you can let Vim parse the error messages of a compiler, and have it jump to a line containing a warning or error and display the ... For examples
    Message 1 of 5 , Jun 6, 2002
    • 0 Attachment
      Tobi, you wrote:
      > dionn@... wrote:
      > > Doing some HTML right now, I wanted tidy to work as my compiler so
      > > I could jump to its errors from the editor. So I issued
      > > :compiler tidy
      > > :make
      >
      > [...]
      >
      > Sounds interesting.
      >
      > I'm using Vim plus XML stuff for editing XHTML, and Xerces-C for
      > validating the XHTML (either via :w<CR>:!validate % or in a separate
      > comandline window).
      > How could I make Vim show where Xerces found errors?

      Basically you can let Vim parse the error messages of a compiler, and
      have it jump to a line containing a warning or error and display the
      message. The relevant documentation you can find here:
      :h 30.1
      :h quickfix

      For examples of compiler-plugins, look at the compiler directory in your
      vim directory.

      Dion
    • dionn@tomtom.com
      ... That s what Vim reports when it performs the make; the same with gvim -V. An interesting detail I overlooked earlier: There is a space between the ...
      Message 2 of 5 , Jun 7, 2002
      • 0 Attachment
        Vince wrote:
        > I would suggest adding some debug to find out
        > exactly what command line Vim is using to
        > invoke tidy... perhaps it's messing up the
        > application of 'shellredir'

        The easy answer to this is this:

        :!tidy -quiet -errors --gnu-emacs yes xxxxxxxx.htm > C:\TEMP\VIeAAB.tmp

        That's what Vim reports when it performs the make; the same with gvim -V.

        An interesting detail I overlooked earlier: There is a space between the
        >-sign and the filename, whereas my shellredir value is this:

        shellredir=>%s 2>&1

        With no space between the redirection symbo and the filename.
        Could it be that Vim doesn't use shellredir when performing a make?
        Investigating further...

        Dion
      • dionn@tomtom.com
        ... Thanks. Entirely correct. I just found it out the hard way (reading the sources). Some comments: - The default on NT for shellpipe is . That doesn t
        Message 3 of 5 , Jun 7, 2002
        • 0 Attachment
          Doug wrote:
          > On Fri, Jun 07, 2002 at 11:15:05AM +0200, dionn@... wrote:
          >
          > <snip>
          >
          > > With no space between the redirection symbo and the filename.
          > > Could it be that Vim doesn't use shellredir when performing a make?
          > > Investigating further...
          >
          > :help shellpipe

          Thanks. Entirely correct.

          I just found it out the hard way (reading the sources).

          Some comments:
          - The default on NT for shellpipe is ">". That doesn't seem to make
          sense, as a lot of compilers will use stderr to redirect their errors
          to. Apart from that, in most cases the Unix default becomes something
          that includes stderr as well; and the shellredir option also includes
          stderr, both for Unix and NT. I suggest the default becomes ">%s
          @>&1", just like the shellredir option.
          - The user manual is wrong. ":h 30.1", in the section "OUTPUT
          REDIRECTION", it is stated that :make uses the shellredir option,
          which it doesn't.
          - Why are there two separate options for redirection of shell commands
          anyway?

          Dion
        • Bram Moolenaar
          ... Since shellredir does get set to this value, I suppose shellpipe can use it as well. I suspect the current #ifdefs were made this way to avoid using
          Message 4 of 5 , Jun 7, 2002
          • 0 Attachment
            Dion Nicolaas wrote:

            > > :help shellpipe
            >
            > Thanks. Entirely correct.
            >
            > I just found it out the hard way (reading the sources).
            >
            > Some comments:
            > - The default on NT for shellpipe is ">". That doesn't seem to make
            > sense, as a lot of compilers will use stderr to redirect their errors
            > to. Apart from that, in most cases the Unix default becomes something
            > that includes stderr as well; and the shellredir option also includes
            > stderr, both for Unix and NT. I suggest the default becomes ">%s
            > @>&1", just like the shellredir option.

            Since 'shellredir' does get set to this value, I suppose 'shellpipe' can
            use it as well. I suspect the current #ifdefs were made this way to
            avoid using "tee". Try the patch below.

            > - The user manual is wrong. ":h 30.1", in the section "OUTPUT
            > REDIRECTION", it is stated that :make uses the shellredir option,
            > which it doesn't.

            I'll fix that.

            > - Why are there two separate options for redirection of shell commands
            > anyway?

            Because a filter command may need different redirection than what's used
            for ":make". On Unix "tee" is used to view the output while it's busy.


            *** ../vim61.088/src/option.c Sun May 5 22:51:14 2002
            --- src/option.c Fri Jun 7 20:33:31 2002
            ***************
            *** 2839,2848 ****
            # endif
            )
            {
            ! #if defined(FEAT_QUICKFIX) && !defined(WIN3264)
            if (do_sp)
            {
            p_sp = (char_u *)"|& tee";
            options[idx_sp].def_val[VI_DEFAULT] = p_sp;
            }
            #endif
            --- 2847,2860 ----
            # endif
            )
            {
            ! #if defined(FEAT_QUICKFIX)
            if (do_sp)
            {
            + # ifdef WIN3264
            + p_sp = (char_u *)">&";
            + # else
            p_sp = (char_u *)"|& tee";
            + # endif
            options[idx_sp].def_val[VI_DEFAULT] = p_sp;
            }
            #endif
            ***************
            *** 2869,2878 ****
            )
            # endif
            {
            ! #if defined(FEAT_QUICKFIX) && !defined(WIN3264)
            if (do_sp)
            {
            p_sp = (char_u *)"2>&1| tee";
            options[idx_sp].def_val[VI_DEFAULT] = p_sp;
            }
            #endif
            --- 2881,2894 ----
            )
            # endif
            {
            ! #if defined(FEAT_QUICKFIX)
            if (do_sp)
            {
            + # ifdef WIN3264
            + p_sp = (char_u *)">%s 2>&1";
            + # else
            p_sp = (char_u *)"2>&1| tee";
            + # endif
            options[idx_sp].def_val[VI_DEFAULT] = p_sp;
            }
            #endif

            --
            hundred-and-one symptoms of being an internet addict:
            128. You can access the Net -- via your portable and cellular phone.

            /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
            /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
            \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
            \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
          • Doug Kearns
            On Fri, Jun 07, 2002 at 11:15:05AM +0200, dionn@tomtom.com wrote: ... Regards, Doug
            Message 5 of 5 , Jun 17, 2002
            • 0 Attachment
              On Fri, Jun 07, 2002 at 11:15:05AM +0200, dionn@... wrote:

              <snip>

              > With no space between the redirection symbo and the filename.
              > Could it be that Vim doesn't use shellredir when performing a make?
              > Investigating further...

              :help shellpipe

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