Thursday, March 7, 2013

Re: problems setting up makeprg and makeef

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@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: