cannot create diffs

595 views
Skip to first unread message

Samuel Ferencik

unread,
Jan 9, 2009, 4:24:08 AM1/9/09
to vim_use
Hi,

when trying to diff two files, I get "E97: Cannot create diffs". It
seems that the 'diffexpr' function does not get called.

I have two user accounts A and B, and a single .vimrc in the A
account. The .vimrc sets [set diffexpr=MyDiff2()] and defines the
function. The diffing works in the A account, but not in the B
account.

I have now modified MyDiff() to prompt me, so I can see it's been
called:

function! MyDiff2()
call input("MyDiff2 called")
endfunction

In both accounts, I see the following:

:set diffexpr?
diffexpr=MyDiff2()

:call MyDiff2()
MyDiff2 called
(I press <CR>)

But the diffing is not the same:

account A:
:windo:difft
MyDiff2 called
(I press <CR>)
E97: Cannot create diffs
(because MyDiff2() does not return "ed" style diffs)

account B:
:windo:difft
E97: Cannot create diffs
(MyDiff2() has not been called!)

Do you have any idea how I can find out more? I have tried verbose=15,
but that did not reveal much.

Thanks,
Sam

John Beckett

unread,
Jan 9, 2009, 6:07:57 PM1/9/09
to vim...@googlegroups.com
Samuel Ferencik wrote:
> In both accounts, I see the following:
>
> :set diffexpr?
> diffexpr=MyDiff2()
>
> :call MyDiff2()
> MyDiff2 called
> (I press <CR>)

You seem to have proved that what you're seeing is impossible, so I
would do one more sanity check. For both accounts:

:set diffexpr?
:function MyDiff2

Does B have exactly what you posted:


function! MyDiff2()
call input("MyDiff2 called")
endfunction

John

Samuel Ferencik

unread,
Jan 12, 2009, 3:56:44 AM1/12/09
to vim_use
Hi John,

thanks for the reply. I have tried your suggestion, and I get the same
output from both accounts:

:function MyDiff2
function MyDiff2()
1 call input("MyDiff2 called")
endfunction

I should have said I was using vim on VMS, which is probably not what
most of you are using. Unfortunately, I have no other multi-user
environment where I could try the same thing with another vim build
(win, unix). I think I will now turn to the vim-vms discussion list.

Is there no other way to look under the hood? What does vim do between
:windo:difft
and calling
'diffexpr'
for the first window?

Thanks,
Sam

Tony Mechelynck

unread,
Jan 12, 2009, 4:25:33 AM1/12/09
to vim...@googlegroups.com
On 12/01/09 09:56, Samuel Ferencik wrote:
> Hi John,
>
> thanks for the reply. I have tried your suggestion, and I get the same
> output from both accounts:
>
> :function MyDiff2
> function MyDiff2()
> 1 call input("MyDiff2 called")
> endfunction
>
> I should have said I was using vim on VMS, which is probably not what
> most of you are using. Unfortunately, I have no other multi-user
> environment where I could try the same thing with another vim build
> (win, unix). I think I will now turn to the vim-vms discussion list.
>
> Is there no other way to look under the hood? What does vim do between
> :windo:difft
> and calling
> 'diffexpr'
> for the first window?
>
> Thanks,
> Sam

Have you tried setting 'diffexpr' to the empty string (for instance by
running "vim -N -u NONE")? And if you have, did it work?

Best regards,
Tony.
--
It's a good thing we don't get all the government we pay for.

Samuel Ferencik

unread,
Jan 12, 2009, 4:50:16 AM1/12/09
to vim_use
Hello,

I have now found the problem.

I looked in the source code, and found that ex_diffupdate() writes
temporary files into $TMP/... Well, my $TMP (in both A and B accounts)
points to a directory in the A account, and this directory was only
writable by A, so vim running under B could not create the temp files.
(I don't even remember why I had $TMP defined in the first place; if
it is unset, diffing works.)

Thank you both for your suggestions.

Sam

On Jan 12, 10:25 am, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:

John Beckett

unread,
Jan 12, 2009, 4:54:31 PM1/12/09
to vim...@googlegroups.com
Samuel Ferencik wrote:
> I have now found the problem.
>
> I looked in the source code, and found that ex_diffupdate()
> writes temporary files into $TMP/... Well, my $TMP (in both A
> and B accounts) points to a directory in the A account, and
> this directory was only writable by A, so vim running under B
> could not create the temp files.

Ah ... we should have thought of that.

BTW we prefer bottom posting on this mailing list.

John

Reply all
Reply to author
Forward
0 new messages