Wednesday, March 6, 2013

Re: problems setting up makeprg and makeef

On Wednesday, March 6, 2013 12:02:40 PM UTC-6, FlashBurn wrote:
> I have setup a vim script to do the following
>
> " Setup the project home directory.
> let s:project_path = 'C:\Documents and Settings\user\Projects\myproject\trunk'
>
> " Setup the project home directory such that Vim can understand it. It will
> " escape white spaces.
> let s:vim_project_path = fnameescape(s:project_path)
> " cd to the project directory.
> set cd=s:vim_project_path
>
> " Setup make command such that shell can understand it.
> " Path to make.exe.
> let &makeprg = shellescape(s:project_path.'\tools\make.exe')
> " Use makefile from 'src\makefile'.
> let &makeprg .= ' -f '.shellescape(s:project_path.'\src\makefile')
> " Change to a directory 'src' before running make.
> let &makeprg .= ' --directory '.shellescape(s:project_path.'\src')
>
> " Setup the file where the output of ':make' will be redirected.
> let &makeef = shellescape(s:project_path.'\src\error.err')
>
> But for some reason whenever I run :make, I'm getting the following error
>
> E40: Can't open errofile :C:/Documents and Settings/user/Projects/myproject/trunk/src/error.err"
>
> I looked at help for E40 but nothing really can explain why this is happening.
>
> Now if my makeef is setup as follows
> let &makeef = ""
>
> Then Windows redirects the output to a temporary file and there are no issues. I'd like to be able to store the output in a given file not in a temporary file.
>
> Does anybody know what is the issue and how it can be fixed?
>
> Any help is appreciated.

I don't know the cause. I suggest three things to try fixing it:

1. Check whether the file is created, regardless of whether Vim can read it.
2. Under :help :make it says Vim basically does this:

":!{makeprg} [arguments] {shellpipe} {errorfile}".

Try manually doing that to see if it works.
3. Try it with makeef set to something not containing spaces or any other special characters, to see whether that at least works. It will be easier to debug without those sorts of things interfering.

I'd try all this with 'noshellslash' set, it appears you're using it somewhere because the E40 message uses forward slashes.

--
--
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:

Post a Comment