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

Suggestion for a change to compiler/gcc.vim

Expand Messages
  • Nikolai Weibull
    I am the maintainer of compiler/gcc.vim and I would like to propose the following change to its errorformat: @@ -20,7 +20,8 @@ setlocal errorformat=
    Message 1 of 8 , Jul 22, 2006
    • 0 Attachment
      I am the maintainer of compiler/gcc.vim and I would like to propose
      the following change to its errorformat:

      @@ -20,7 +20,8 @@ setlocal errorformat=
      \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
      \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
      \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
      - \%DMaking\ %*\\a\ in\ %f
      + \%DMaking\ %*\\a\ in\ %f,
      + \%-G%.%#

      let &cpo = s:cpo_save
      unlet s:cpo_save

      The reason for this change is that I find it tiresome that whenever a
      successful build it built, I have to press enter twice to first get
      through the "shell output is finished, please hit Enter" prompt and
      then "Hi, I'm gcc command-line number one that successfully compiled
      file so and so, and hey, there are 18 more of these commands waiting
      for you to look through, so please begin by hitting Enter".

      So the addition of %-G%.%# to exclude anything but the defined formats
      from the listing saves us the trouble of seeing useless compiler
      command-lines in the list of changes.

      However, this is a rather drastic measure, and may cause messages that
      people rely on to go missing. If so, then this patch is perhaps not
      for public consumption. We do have the chance to add these messages
      to the errorformat, however, so if someone has any suggestions, please
      do pass them on.

      Any comments?

      Thanks.

      nikolai
    • Ilya
      ... If this is really such a drastic change, then maybe you could make it optional? So that one who likes (or dislikes) pressing enter could add let
      Message 2 of 8 , Jul 22, 2006
      • 0 Attachment
        Nikolai Weibull wrote:
        > I am the maintainer of compiler/gcc.vim and I would like to propose
        > the following change to its errorformat:
        >
        > @@ -20,7 +20,8 @@ setlocal errorformat=
        > \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
        > \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
        > \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
        > - \%DMaking\ %*\\a\ in\ %f
        > + \%DMaking\ %*\\a\ in\ %f,
        > + \%-G%.%#
        >
        > let &cpo = s:cpo_save
        > unlet s:cpo_save
        >
        > The reason for this change is that I find it tiresome that whenever a
        > successful build it built, I have to press enter twice to first get
        > through the "shell output is finished, please hit Enter" prompt and
        > then "Hi, I'm gcc command-line number one that successfully compiled
        > file so and so, and hey, there are 18 more of these commands waiting
        > for you to look through, so please begin by hitting Enter".
        >
        > So the addition of %-G%.%# to exclude anything but the defined formats
        > from the listing saves us the trouble of seeing useless compiler
        > command-lines in the list of changes.
        >
        > However, this is a rather drastic measure, and may cause messages that
        > people rely on to go missing. If so, then this patch is perhaps not
        > for public consumption. We do have the chance to add these messages
        > to the errorformat, however, so if someone has any suggestions, please
        > do pass them on.
        >
        > Any comments?
        >
        > Thanks.
        >
        > nikolai
        >
        >
        If this is really such a drastic change, then maybe you could make it
        optional? So that one who likes (or dislikes) pressing enter could add
        let g:compiler_gcc_show_success_lines = 1 (or let
        g:compiler_gcc_hide_success_lines = 1) to his or her .vimrc to have
        desired behavior.
      • Nikolai Weibull
        ... Yes, that s certainly a way of doing it. Anyone have any more input? I guess to stay with how things have worked we should use
        Message 3 of 8 , Jul 22, 2006
        • 0 Attachment
          On 7/22/06, Ilya <ilya@...> wrote:
          > Nikolai Weibull wrote:

          > > So the addition of %-G%.%# to exclude anything but the defined formats
          > > from the listing saves us the trouble of seeing useless compiler
          > > command-lines in the list of changes.

          > If this is really such a drastic change, then maybe you could make it
          > optional? So that one who likes (or dislikes) pressing enter could add
          > let g:compiler_gcc_show_success_lines = 1 (or let
          > g:compiler_gcc_hide_success_lines = 1) to his or her .vimrc to have
          > desired behavior.

          Yes, that's certainly a way of doing it. Anyone have any more input?
          I guess to stay with how things have worked we should use
          g:compiler_gcc_hide_success_lines.

          Also, am I the only one annoyed by having to deal with the extra lines
          after a successful compile?

          nikolai
        • Ilya
          ... I m not quite sure that it may help, but do you know that you may mark line as been general information line? Specially for compiler version strings or
          Message 4 of 8 , Jul 22, 2006
          • 0 Attachment
            Nikolai Weibull wrote:
            > I am the maintainer of compiler/gcc.vim and I would like to propose
            > the following change to its errorformat:
            >
            > @@ -20,7 +20,8 @@ setlocal errorformat=
            > \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
            > \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
            > \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
            > - \%DMaking\ %*\\a\ in\ %f
            > + \%DMaking\ %*\\a\ in\ %f,
            > + \%-G%.%#
            >
            > let &cpo = s:cpo_save
            > unlet s:cpo_save
            >
            > The reason for this change is that I find it tiresome that whenever a
            > successful build it built, I have to press enter twice to first get
            > through the "shell output is finished, please hit Enter" prompt and
            > then "Hi, I'm gcc command-line number one that successfully compiled
            > file so and so, and hey, there are 18 more of these commands waiting
            > for you to look through, so please begin by hitting Enter".
            I'm not quite sure that it may help, but do you know that you may mark
            line as been general information line? Specially for "compiler version
            strings or other headers that can be skipped". See :help efm-ignore
            > So the addition of %-G%.%# to exclude anything but the defined formats
            > from the listing saves us the trouble of seeing useless compiler
            > command-lines in the list of changes.
            >
            > However, this is a rather drastic measure, and may cause messages that
            > people rely on to go missing. If so, then this patch is perhaps not
            > for public consumption. We do have the chance to add these messages
            > to the errorformat, however, so if someone has any suggestions, please
            > do pass them on.
            >
            > Any comments?
            >
            > Thanks.
            >
            > nikolai
            >
            >
          • Nikolai Weibull
            ... Yes (%+G instead of %-G), but why would I want to mark stuff like gcc -I. -I.. -D... ... as a general information line? That s just the thing that would
            Message 5 of 8 , Jul 22, 2006
            • 0 Attachment
              On 7/22/06, Ilya <ilya@...> wrote:

              > Nikolai Weibull wrote:

              > > @@ -20,7 +20,8 @@ setlocal errorformat=
              > > \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
              > > \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
              > > \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
              > > - \%DMaking\ %*\\a\ in\ %f
              > > + \%DMaking\ %*\\a\ in\ %f,
              > > + \%-G%.%#

              > I'm not quite sure that it may help, but do you know that you may mark
              > line as been general information line? Specially for "compiler version
              > strings or other headers that can be skipped". See :help efm-ignore

              Yes (%+G instead of %-G), but why would I want to mark stuff like "gcc
              -I. -I.. -D... ..." as a general information line? That's just the
              thing that would happen by default. This way we can ignore that kind
              of output.

              nikolai
            • Gary Johnson
              ... No, they annoy me too. I have had %-G%.%# as the last component of my gcc errorformat for as long as I can remember and have never had any problems with
              Message 6 of 8 , Jul 23, 2006
              • 0 Attachment
                On 2006-07-22, Nikolai Weibull <now@...> wrote:
                > On 7/22/06, Ilya <ilya@...> wrote:
                > > Nikolai Weibull wrote:
                >
                > > > So the addition of %-G%.%# to exclude anything but the defined formats
                > > > from the listing saves us the trouble of seeing useless compiler
                > > > command-lines in the list of changes.
                >
                > > If this is really such a drastic change, then maybe you could make it
                > > optional? So that one who likes (or dislikes) pressing enter could add
                > > let g:compiler_gcc_show_success_lines = 1 (or let
                > > g:compiler_gcc_hide_success_lines = 1) to his or her .vimrc to have
                > > desired behavior.
                >
                > Yes, that's certainly a way of doing it. Anyone have any more input?
                > I guess to stay with how things have worked we should use
                > g:compiler_gcc_hide_success_lines.
                >
                > Also, am I the only one annoyed by having to deal with the extra lines
                > after a successful compile?

                No, they annoy me too. I have had

                %-G%.%#

                as the last component of my gcc errorformat for as long as I can
                remember and have never had any problems with it.

                I suppose for backwards compatibility you should use
                g:compiler_gcc_hide_success_lines. On the other hand, it seems
                unlikely that a script or a user would depend on the presence of
                those extra lines, and the new or inexperienced user who would be
                most likely to be confused by those extra lines is also the user
                least likely to find the g:compiler_gcc_hide_success_lines option.
                So if you wanted to keep it simple, I think it would be OK to just
                add that term unconditionally.

                Regards,
                Gary

                --
                Gary Johnson | Agilent Technologies
                garyjohn@... | Wireless Division
                | Spokane, Washington, USA
              • Nicolas Schodet
                ... This could be a quite dangerous measure as any unrecognised line will be totally ignored. Moreover, many Makefiles include other commands, and their output
                Message 7 of 8 , Aug 1, 2006
                • 0 Attachment
                  * Nikolai Weibull <now@...> [060722 12:08]:
                  > I am the maintainer of compiler/gcc.vim and I would like to propose
                  > the following change to its errorformat:

                  > @@ -20,7 +20,8 @@ setlocal errorformat=
                  > \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
                  > \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
                  > \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
                  > - \%DMaking\ %*\\a\ in\ %f
                  > + \%DMaking\ %*\\a\ in\ %f,
                  > + \%-G%.%#
                  >
                  > let &cpo = s:cpo_save
                  > unlet s:cpo_save

                  > The reason for this change is that I find it tiresome that whenever a
                  > successful build it built, I have to press enter twice to first get
                  > through the "shell output is finished, please hit Enter" prompt and
                  > then "Hi, I'm gcc command-line number one that successfully compiled
                  > file so and so, and hey, there are 18 more of these commands waiting
                  > for you to look through, so please begin by hitting Enter".
                  > So the addition of %-G%.%# to exclude anything but the defined formats
                  > from the listing saves us the trouble of seeing useless compiler
                  > command-lines in the list of changes.
                  > However, this is a rather drastic measure, and may cause messages that
                  > people rely on to go missing. If so, then this patch is perhaps not
                  > for public consumption. We do have the chance to add these messages
                  > to the errorformat, however, so if someone has any suggestions, please
                  > do pass them on.
                  > Any comments?

                  This could be a quite dangerous measure as any unrecognised line will be
                  totally ignored. Moreover, many Makefiles include other commands, and
                  their output should generally not be lost.

                  If you add this feature, I propose not to make it the default. This
                  feature is not only useful with gcc, so the variable used to activate it
                  could have a general name and be used in several compiler files.

                  By the way, here is two lines coming from the default errorformat
                  option:

                  \%D%*\\a:\ Entering\ directory\ `%f',
                  \%X%*\\a:\ Leaving\ directory\ `%f',

                  They are useful when using the -C option from the vim command line.
                  What do you think of adding them?

                  Thanks,

                  Nicolas.
                • Nikolai Weibull
                  ... Precisely the point. If Vim can t determine how the output of a command should be interpreted it should be ignored. It s as simple as that. If you have
                  Message 8 of 8 , Dec 20, 2006
                  • 0 Attachment
                    On 8/1/06, Nicolas Schodet <nico@...> wrote:
                    > * Nikolai Weibull <now@...> [060722 12:08]:
                    > > I am the maintainer of compiler/gcc.vim and I would like to propose
                    > > the following change to its errorformat:
                    >
                    > > @@ -20,7 +20,8 @@ setlocal errorformat=
                    > > \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
                    > > \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
                    > > \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
                    > > - \%DMaking\ %*\\a\ in\ %f
                    > > + \%DMaking\ %*\\a\ in\ %f,
                    > > + \%-G%.%#
                    > >
                    > > let &cpo = s:cpo_save
                    > > unlet s:cpo_save
                    >
                    > > The reason for this change is that I find it tiresome that whenever a
                    > > successful build it built, I have to press enter twice to first get
                    > > through the "shell output is finished, please hit Enter" prompt and
                    > > then "Hi, I'm gcc command-line number one that successfully compiled
                    > > file so and so, and hey, there are 18 more of these commands waiting
                    > > for you to look through, so please begin by hitting Enter".
                    > > So the addition of %-G%.%# to exclude anything but the defined formats
                    > > from the listing saves us the trouble of seeing useless compiler
                    > > command-lines in the list of changes.
                    > > However, this is a rather drastic measure, and may cause messages that
                    > > people rely on to go missing. If so, then this patch is perhaps not
                    > > for public consumption. We do have the chance to add these messages
                    > > to the errorformat, however, so if someone has any suggestions, please
                    > > do pass them on.
                    > > Any comments?
                    >
                    > This could be a quite dangerous measure as any unrecognised line will be
                    > totally ignored. Moreover, many Makefiles include other commands, and
                    > their output should generally not be lost.

                    Precisely the point. If Vim can't determine how the output of a
                    command should be interpreted it should be ignored. It's as simple as
                    that. If you have some special needs, it really should be treated
                    separately.

                    > If you add this feature, I propose not to make it the default. This
                    > feature is not only useful with gcc, so the variable used to activate it
                    > could have a general name and be used in several compiler files.

                    True, that could be useful, but it should be on by default.

                    > By the way, here is two lines coming from the default errorformat
                    > option:
                    >
                    > \%D%*\\a:\ Entering\ directory\ `%f',
                    > \%X%*\\a:\ Leaving\ directory\ `%f',
                    >
                    > They are useful when using the -C option from the vim command line.
                    > What do you think of adding them?

                    OK, I'll add them.

                    nikolai
                  Your message has been successfully submitted and would be delivered to recipients shortly.