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

Re: problems setting up makeprg and makeef

Expand Messages
  • Ben Fritz
    ... That s an acceptable workaround, I think. But maybe it should be supported if it actually isn t. I personally avoid using paths with spaces whenever
    Message 1 of 9 , Mar 6 2:16 PM
    • 0 Attachment
      On Wednesday, March 6, 2013 3:49:11 PM UTC-6, FlashBurn wrote:
      >
      > I think I know where the problem is.
      > It is the spaces in the path. The error.err file is created. But when vim tries to open there it sees spaces in it, that's why it can't open it. The solution, I decided to use is the 8dot3 path. Thanks for the help everyone.

      That's an acceptable workaround, I think. But maybe it should be supported if it actually isn't. I personally avoid using paths with spaces whenever possible, especially now that I'm on Windows 7 and can use C:\Users instead of "C:\Documents and Settings".

      To make it even nicer for yourself, Vim can automatically build the 8.3 path for you. See:

      :help fnamemodify()
      :help filename-modifiers

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • FlashBurn
      ... Well, I keep finding more problems with my script. It turns out it works find if there are no errors during compilation. Once compiler detects and error
      Message 2 of 9 , Mar 7 7:43 AM
      • 0 Attachment
        On Wednesday, March 6, 2013 5:16:31 PM UTC-5, Ben Fritz wrote:
        > On Wednesday, March 6, 2013 3:49:11 PM UTC-6, FlashBurn wrote:
        > >
        > > I think I know where the problem is.
        > > It is the spaces in the path. The error.err file is created. But when vim tries to open there it sees spaces in it, that's why it can't open it. The solution, I decided to use is the 8dot3 path. Thanks for the help everyone.
        >
        > That's an acceptable workaround, I think. But maybe it should be supported if it actually isn't. I personally avoid using paths with spaces whenever possible, especially now that I'm on Windows 7 and can use C:\Users instead of "C:\Documents and Settings".
        >
        > To make it even nicer for yourself, Vim can automatically build the 8.3 path for you. See:
        >
        > :help fnamemodify()
        > :help filename-modifiers

        Well, I keep finding more problems with my script. It turns out it works find if there are no errors during compilation. Once compiler detects and error during compilation something interesting is happening. It tries to open the error.err file and generates the following error:
        shell returned2
        E303: Unable to open swap file for "and Settings\user\Projects\MyProject\trunk\src\myfile.c
        "and Settings\user\Projects\MyProject\trunk\src\myfile.c,60 Error"[New DIRECTORY]

        Does anybody know what is going on and how I can fix it? Any help is appreciated.

        Here is my project setup script:

        Here is my modified script, using Ben's advice for 8dot3 file path generation.
        " Setup the project home directory.
        let s:project_path = 'C:\Documents and Settings\user\Projects\MyProject\trunk'
        let s:project_path_8dot3 = fnamemodify(s:project_path, ':8')

        " Setup the project home directory.
        let s:vim_project_path = fnameescape(s:project_path)
        set cd=s:project_path_8dot3

        " Setup make command.
        " 1. Use makefile from 'src\makefile'.
        " 2. Change to a 'src' directory before running make.
        let &makeprg = s:project_path_8dot3.'\tools\make.exe'
        let &makeprg .= ' -f '.s:project_path_8dot3.'\src\makefile'
        let &makeprg .= ' --directory '.s:project_path_8dot3.'\src'

        " Setup the file where the output of ':make' will be redirected.
        let &makeef = s:project_path_8dot3.'\src\error.err'

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Ben Fritz
        ... As Gary mentioned, this set cd= line is NOT doing what you seem to think it is doing. Fix this first, it looks like your make program is outputting paths
        Message 3 of 9 , Mar 7 8:40 AM
        • 0 Attachment
          On Thursday, March 7, 2013 9:43:46 AM UTC-6, FlashBurn wrote:
          > On Wednesday, March 6, 2013 5:16:31 PM UTC-5, Ben Fritz wrote:
          > > On Wednesday, March 6, 2013 3:49:11 PM UTC-6, FlashBurn wrote:
          > > >
          > > > I think I know where the problem is.
          > > > It is the spaces in the path. The error.err file is created. But when vim tries to open there it sees spaces in it, that's why it can't open it. The solution, I decided to use is the 8dot3 path. Thanks for the help everyone.
          > >
          > > That's an acceptable workaround, I think. But maybe it should be supported if it actually isn't. I personally avoid using paths with spaces whenever possible, especially now that I'm on Windows 7 and can use C:\Users instead of "C:\Documents and Settings".
          > >
          > > To make it even nicer for yourself, Vim can automatically build the 8.3 path for you. See:
          > >
          > > :help fnamemodify()
          > > :help filename-modifiers
          >
          > Well, I keep finding more problems with my script. It turns out it works find if there are no errors during compilation. Once compiler detects and error during compilation something interesting is happening. It tries to open the error.err file and generates the following error:
          > shell returned2
          > E303: Unable to open swap file for "and Settings\user\Projects\MyProject\trunk\src\myfile.c
          > "and Settings\user\Projects\MyProject\trunk\src\myfile.c,60 Error"[New DIRECTORY]
          >
          > Does anybody know what is going on and how I can fix it? Any help is appreciated.
          >
          > Here is my project setup script:
          >
          > Here is my modified script, using Ben's advice for 8dot3 file path generation.
          > " Setup the project home directory.
          > let s:project_path = 'C:\Documents and Settings\user\Projects\MyProject\trunk'
          > let s:project_path_8dot3 = fnamemodify(s:project_path, ':8')
          >
          > " Setup the project home directory.
          > let s:vim_project_path = fnameescape(s:project_path)
          > set cd=s:project_path_8dot3

          As Gary mentioned, this "set cd=" line is NOT doing what you seem to think it is doing. Fix this first, it looks like your make program is outputting paths with spaces, and I don't know whether Vim will be able to handle those very well.

          >
          > " Setup make command.
          > " 1. Use makefile from 'src\makefile'.
          > " 2. Change to a 'src' directory before running make.
          > let &makeprg = s:project_path_8dot3.'\tools\make.exe'
          > let &makeprg .= ' -f '.s:project_path_8dot3.'\src\makefile'
          > let &makeprg .= ' --directory '.s:project_path_8dot3.'\src'
          >
          > " Setup the file where the output of ':make' will be redirected.
          > let &makeef = s:project_path_8dot3.'\src\error.err'

          You may need to set the 'errorformat' option as well.

          If I were you, when I'm all done, I'd consider making this a compiler plugin. See :help write-compiler-plugin.

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Gary Johnson
          ... This looks like a problem with your errorformat . The compiler found an error at line 60 of myfile.c, but your errorformat is incorrectly parsing that
          Message 4 of 9 , Mar 7 10:51 AM
          • 0 Attachment
            On 2013-03-07, FlashBurn wrote:

            > Well, I keep finding more problems with my script. It turns out it
            > works find if there are no errors during compilation. Once
            > compiler detects and error during compilation something
            > interesting is happening. It tries to open the error.err file and
            > generates the following error:
            > shell returned2
            > E303: Unable to open swap file for "and Settings\user\Projects\MyProject\trunk\src\myfile.c
            > "and Settings\user\Projects\MyProject\trunk\src\myfile.c,60 Error"[New DIRECTORY]
            >
            > Does anybody know what is going on and how I can fix it? Any help
            > is appreciated.

            This looks like a problem with your 'errorformat'. The compiler
            found an error at line 60 of myfile.c, but your 'errorformat' is
            incorrectly parsing that message so that Vim tries to jump to an
            error in a file named
            "and Settings\user\Projects\MyProject\trunk\src\myfile.c,60 Error".

            Regards,
            Gary

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Ben Fritz
            ... I agree, but I think getting the cd command correct might actually fix this problem, because possibly the OP s make program will not output the full path
            Message 5 of 9 , Mar 7 10:59 AM
            • 0 Attachment
              On Thursday, March 7, 2013 12:51:46 PM UTC-6, Gary Johnson wrote:
              > On 2013-03-07, FlashBurn wrote:
              >
              > > shell returned2
              >
              > > E303: Unable to open swap file for "and Settings\user\Projects\MyProject\trunk\src\myfile.c
              >
              > > "and Settings\user\Projects\MyProject\trunk\src\myfile.c,60 Error"[New DIRECTORY]
              >
              > >
              >
              > > Does anybody know what is going on and how I can fix it? Any help
              >
              > > is appreciated.
              >
              >
              >
              > This looks like a problem with your 'errorformat'. The compiler
              >
              > found an error at line 60 of myfile.c, but your 'errorformat' is
              >
              > incorrectly parsing that message so that Vim tries to jump to an
              >
              > error in a file named
              >
              > "and Settings\user\Projects\MyProject\trunk\src\myfile.c,60 Error".
              >

              I agree, but I think getting the "cd" command correct might actually fix this problem, because possibly the OP's make program will not output the full path if it's already running from a directory within that path. But that might be wishful thinking on my part.

              Note that E303 can be caused on Windows 7 because Vim looks in C:\Temp and C:\TMP rather than $TEMP and $TMP for swap files by default; you can fix this by modifying your 'directory' option. But, Vim will still be looking in the wrong location for the file itself. And, Windows 7 has "C:\Users\blah" instead of "C:\Documents and Settings\blah" so it's not as likely to be the cause in this case.

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            Your message has been successfully submitted and would be delivered to recipients shortly.