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

patch for compiler/tidy.vim

Expand Messages
  • Mark Stosberg
    Hello, I m currently using vim 6.1.262 with a version of tidy from the new project at http://tidy.sf.net/ that has taken over the original author s work.
    Message 1 of 5 , Jan 31, 2003
    • 0 Attachment
      Hello,

      I'm currently using vim 6.1.262 with a version of "tidy" from the new
      project at http://tidy.sf.net/ that has taken over the original author's
      work.

      However, I found that the "compiler/tidy.vim" file distributed with vim
      was not fully functional-- the errorfmt string was not working.

      After researching this some, it seemed patching this file was the best
      solution. Here's the patch, which seems to work for me.

      The tidy version I'm using is described as:
      "HTML Tidy for FreeBSD released on 1st January 2003"

      Mark
      ####
      --- tidy.vim.orig Fri Jan 31 15:11:47 2003
      +++ tidy.vim Fri Jan 31 15:17:35 2003
      @@ -19,6 +19,6 @@
      setlocal makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %
      endif

      -" sample warning: foo.html:8:1: Warning: inserting missing 'foobar' element
      -" sample error: foo.html:9:2: Error: <foobar> is not recognized!
      -setlocal errorformat=%f:%l:%c:\ Error:%m,%f:%l:%c:\ Warning:%m,%-G%.%#
      +" sample error: line 18 column 17 - Error: message
      +" sample warning: line 18 column 17 - Warning: message
      +setlocal errorformat=line\ %l\ column\ %c\ -\ Error:%m,line\ %l\ column\ %c\ -\ Warning:%m,%-G%.%#
      ####
      --
      http://mark.stosberg.com/
    • Bram Moolenaar
      ... It looks like it would not be too difficult to handle both formats. Just append all the alternatives. That needs to be tested though! -- ... /// Bram
      Message 2 of 5 , Jan 31, 2003
      • 0 Attachment
        Mark Stosberg wrote:

        > I'm currently using vim 6.1.262 with a version of "tidy" from the new
        > project at http://tidy.sf.net/ that has taken over the original author's
        > work.
        >
        > However, I found that the "compiler/tidy.vim" file distributed with vim
        > was not fully functional-- the errorfmt string was not working.
        >
        > After researching this some, it seemed patching this file was the best
        > solution. Here's the patch, which seems to work for me.
        >
        > The tidy version I'm using is described as:
        > "HTML Tidy for FreeBSD released on 1st January 2003"
        >
        > Mark
        > ####
        > --- tidy.vim.orig Fri Jan 31 15:11:47 2003
        > +++ tidy.vim Fri Jan 31 15:17:35 2003
        > @@ -19,6 +19,6 @@
        > setlocal makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %
        > endif
        >
        > -" sample warning: foo.html:8:1: Warning: inserting missing 'foobar' element
        > -" sample error: foo.html:9:2: Error: <foobar> is not recognized!
        > -setlocal errorformat=%f:%l:%c:\ Error:%m,%f:%l:%c:\ Warning:%m,%-G%.%#
        > +" sample error: line 18 column 17 - Error: message
        > +" sample warning: line 18 column 17 - Warning: message
        > +setlocal errorformat=line\ %l\ column\ %c\ -\ Error:%m,line\ %l\ column\ %c\ -\ Warning:%m,%-G%.%#
        > ####

        It looks like it would not be too difficult to handle both formats.
        Just append all the alternatives. That needs to be tested though!

        --
        From "know your smileys":
        :-& Eating spaghetti

        /// 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 ///
      • Mark Stosberg
        ... Thanks for the response Doug. This works better in the sense that it causes output to be produced that is almost identical the output format before. There
        Message 3 of 5 , Feb 1, 2003
        • 0 Attachment
          On Sun, 2 Feb 2003, Doug Kearns wrote:

          > On Fri, Jan 31, 2003 at 03:30:48PM -0500, Mark Stosberg wrote:
          > > Hello,
          > >
          > > I'm currently using vim 6.1.262 with a version of "tidy" from the new
          > > project at http://tidy.sf.net/ that has taken over the original author's
          > > work.
          > >
          > > However, I found that the "compiler/tidy.vim" file distributed with vim
          > > was not fully functional-- the errorfmt string was not working.
          > >
          > > After researching this some, it seemed patching this file was the best
          > > solution. Here's the patch, which seems to work for me.
          > >
          > > The tidy version I'm using is described as:
          > > "HTML Tidy for FreeBSD released on 1st January 2003"
          >
          > The problem is that there is currently Tidy Classic and Tidy Library and
          > neither of these have been released, in a traditional sense in over two
          > years...
          >
          > Apparently, the Compile Farm builds have recently been moved over to the
          > library version, which has introduced a new option '--gnu-emacs-file' to
          > specify the filename used in the errorformat. If this option is not
          > present then '--gnu-emacs' is _silently_ ignored. I'm currently trying
          > to find out what this new option's purpose is and will update tidy.vim
          > when the 'situation' is clarified. Until then you can change the makeprg
          > line to:
          >
          > setlocal makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ --gnu-emacs-file\ %\ %

          Thanks for the response Doug. This works better in the sense that it
          causes output to be produced that is almost identical the output format
          before. There is one minor difference: There is no space between the last
          colon and "Error" or "Warning" as there was before. This patch against
          the tidy.vim distributed with Vim illustrates this:

          --- tidy.vim.orig Fri Jan 31 15:11:47 2003
          +++ tidy.vim Sat Feb 1 12:52:46 2003
          @@ -16,9 +16,9 @@
          if exists("tidy_compiler_040800")
          setlocal makeprg=tidy\ -errors\ --gnu-emacs\ yes\ %
          else
          - setlocal makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %
          + setlocal makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ --gnu-emacs-file\ %\ %
          endif

          -" sample warning: foo.html:8:1: Warning: inserting missing 'foobar' element
          -" sample error: foo.html:9:2: Error: <foobar> is not recognized!
          -setlocal errorformat=%f:%l:%c:\ Error:%m,%f:%l:%c:\ Warning:%m,%-G%.%#
          +" sample warning: foo.html:8:1:Warning: inserting missing 'foobar' element
          +" sample error: foo.html:9:2:Error: <foobar> is not recognized!
          +setlocal errorformat=%f:%l:%c:Error:%m,%f:%l:%c:Warning:%m,%-G%.%#

          #######

          Perhaps it should be considered a bug in tidy that the format changed?

          Mark
        • Doug Kearns
          ... The problem is that there is currently Tidy Classic and Tidy Library and neither of these have been released, in a traditional sense in over two years...
          Message 4 of 5 , Feb 1, 2003
          • 0 Attachment
            On Fri, Jan 31, 2003 at 03:30:48PM -0500, Mark Stosberg wrote:
            > Hello,
            >
            > I'm currently using vim 6.1.262 with a version of "tidy" from the new
            > project at http://tidy.sf.net/ that has taken over the original author's
            > work.
            >
            > However, I found that the "compiler/tidy.vim" file distributed with vim
            > was not fully functional-- the errorfmt string was not working.
            >
            > After researching this some, it seemed patching this file was the best
            > solution. Here's the patch, which seems to work for me.
            >
            > The tidy version I'm using is described as:
            > "HTML Tidy for FreeBSD released on 1st January 2003"

            The problem is that there is currently Tidy Classic and Tidy Library and
            neither of these have been released, in a traditional sense in over two
            years...

            Apparently, the Compile Farm builds have recently been moved over to the
            library version, which has introduced a new option '--gnu-emacs-file' to
            specify the filename used in the errorformat. If this option is not
            present then '--gnu-emacs' is _silently_ ignored. I'm currently trying
            to find out what this new option's purpose is and will update tidy.vim
            when the 'situation' is clarified. Until then you can change the makeprg
            line to:

            setlocal makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ --gnu-emacs-file\ %\ %

            If this doesn't work let me know and I'll help you sort it out
            privately.

            Regards,
            Doug
          • Doug Kearns
            ... ... Sorry, I misssed that. ... Yes, probably. I ll send a patch to tidy-develop. Thanks, Doug
            Message 5 of 5 , Feb 1, 2003
            • 0 Attachment
              On Sat, Feb 01, 2003 at 12:57:46PM -0500, Mark Stosberg wrote:
              > On Sun, 2 Feb 2003, Doug Kearns wrote:

              <snip>

              > Thanks for the response Doug. This works better in the sense that it
              > causes output to be produced that is almost identical the output format
              > before. There is one minor difference: There is no space between the last
              > colon and "Error" or "Warning" as there was before.

              Sorry, I misssed that.

              <snip>

              > Perhaps it should be considered a bug in tidy that the format changed?

              Yes, probably. I'll send a patch to tidy-develop.

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