Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-21 Fir de Conversatie Steve Hall
On Fri, 2011-03-18 at 18:35 -0400, James Vega wrote:
 
 The default vimrc is no vimrc.

...except on Windows...

 There's an example vimrc that the installer installs to $VIM (which
 one can change through the Advanced install options).

 Part of the confusion, IMO, is that, on Windows, Vim treats
 $VIM/_vimrc as an alternative location for the user's vimrc instead
 of as the system-wide vimrc. So, unlike on unix-like platforms,
 $VIM/_vimrc is *only* sourced if $HOME/_vimrc doesn't exist instead
 of always being sourced.

I'm a little confused here, unless the user adds $HOME/_vimrc, then
$VIM/_vimrc will be sourced by default, no? Which means there IS a
default vimrc on Windows.

 The other bit is that the Windows installers (both yours and
 Bram's), have decided to use this to, by default, coddle new users
 by installing a vimrc to $VIM/_vimrc enabling a bunch of options to
 make Vim act more like a typical Windows application. That may be
 the right thing to do for new users, and leave the more experienced
 users to unselect that option (as I do) when installing Vim on a new
 Windows system. It depends on what learning curve you want to
 present to new users.

Our installer is simply trying to duplicate the default Vim installer
behavior. Whatever gets decided for the default will get adapted to
ours.

I also agree that the mswin option is confusing. I don't think that
keeping it makes Vim any more understandable. (One of the reasons
Cream was originally developed.) It forks the default Vim behavior by
platform. (Ironically, Cream was developed to maintain the standard
CUA behavior + features ACROSS platforms.)

But then, should nocompatible be set by default on Windows, too?

  IMO, the correct behavior should be an empty vimrc named
  vimrc-example. Various features can be included (commented) with
  simple explanatory text, like a reference tutorial of the top 100
  features most users tamper with. The first line explains how to
  rename the file to activate it.
 
 Something similar to http://vim.wikia.com/wiki/Example_vimrc, but
 with more settings commented out?

Exactly.

-- 
Steve Hall  [ digitect dancingpaper com ]


-- 
You received this message from the vim_dev 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


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-21 Fir de Conversatie Steve Hall
On Fri, 2011-03-18 at 10:46 -0700, Ben Fritz wrote:
 On Mar 18, 12:35 pm, Ben Fritz fritzophre...@gmail.com wrote:
 
  http://vim.wikia.com/wiki/Running_diff#Vim_distribution_from_Cream
 
  It looks like some changes have been made since the wiki article
  was written, I'm not sure if issues remain. It looks like at least
  the '!' placement has been fixed.
 
 ...but the backslash issues have not been fixed. Steve, the version
 installed on my machine (I always choose to overwrite the _vimrc)
 looks like this on line 20:
 
 if sh =~ '\cmd'
   let cmd = '\' . $VIMRUNTIME . '\diff\'
   let eq = '\\'
 
 If I get rid of the extra backslashes so it matches the version you
 posted, it works fine. If the backslashes are left in, it breaks as
 the OP describes.

Ok, I have fixed this in our build code, effective our the next
distributed build.

Unless other conversation decides to eliminate the default vimrc for
Windows entirely... :)

-- 
Steve Hall  [ digitect dancingpaper com ]


-- 
You received this message from the vim_dev 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


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-21 Fir de Conversatie James Vega
On Mon, Mar 21, 2011 at 08:24:05PM -0400, Steve Hall wrote:
 On Fri, 2011-03-18 at 18:35 -0400, James Vega wrote:
  
  The default vimrc is no vimrc.
 
 ...except on Windows...

That's an implementation detail of the installer which can be disabled
by the user.  There's no requirement for there to be $VIM/_vimrc.

  There's an example vimrc that the installer installs to $VIM (which
  one can change through the Advanced install options).
 
  Part of the confusion, IMO, is that, on Windows, Vim treats
  $VIM/_vimrc as an alternative location for the user's vimrc instead
  of as the system-wide vimrc. So, unlike on unix-like platforms,
  $VIM/_vimrc is *only* sourced if $HOME/_vimrc doesn't exist instead
  of always being sourced.
 
 I'm a little confused here, unless the user adds $HOME/_vimrc, then
 $VIM/_vimrc will be sourced by default, no? Which means there IS a
 default vimrc on Windows.

See above reply.  There are two default locations for a vimrc on Windows
($HOME/_vimrc and $VIM/_vimrc, in order), which seems unnecessary to me.

If there are to be system-wide defaults, they should be in $VIM/vimrc.
If a user wants a base vimrc to be installed for them when they install
Vim, they should explicitly enable that in the installer and it should
be installed to $HOME/_vimrc.

Having different behavior on different platforms when one of Vim's
selling points is that it is a very portable editor doesn't make sense.
There are obviously going to be system-dependent features/functionality,
but the overall functionality should be consistent across platforms.

  The other bit is that the Windows installers (both yours and
  Bram's), have decided to use this to, by default, coddle new users
  by installing a vimrc to $VIM/_vimrc enabling a bunch of options to
  make Vim act more like a typical Windows application. That may be
  the right thing to do for new users, and leave the more experienced
  users to unselect that option (as I do) when installing Vim on a new
  Windows system. It depends on what learning curve you want to
  present to new users.
 
 Our installer is simply trying to duplicate the default Vim installer
 behavior. Whatever gets decided for the default will get adapted to
 ours.

Right, I wasn't trying to call you out specifically.  I realize this is
also the behavior in the standard installer.

 I also agree that the mswin option is confusing. I don't think that
 keeping it makes Vim any more understandable. (One of the reasons
 Cream was originally developed.) It forks the default Vim behavior by
 platform. (Ironically, Cream was developed to maintain the standard
 CUA behavior + features ACROSS platforms.)
 
 But then, should nocompatible be set by default on Windows, too?

If I remember correctly, the installed vimrc sources vimrc_example.vim,
so nocompatible is set.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega james...@jamessan.com


signature.asc
Description: Digital signature


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-18 Fir de Conversatie Steve Hall
On Thu, 2011-03-17 at 14:33 -0700, Ben Fritz wrote:

 I know for quite some time, the diffexpr given in vimrc_example.vim
 (or wherever it is given in the default cream setup) is broken on
 Windows. Perhaps it still is broken?

First I've heard. Can we not start distributing .vimrc and _vimrc
instead of relying on the installer to create these?

Below is the _vimrc generated by the Cream installer, taken from Vim's
installer years ago. If someone can point out how it differs from the
current Vim default, I'll fix it.

--
Steve Hall  [ digitect dancingpaper com ]


-
  1:set nocompatible
  2:source $VIMRUNTIME/vimrc_example.vim
  3:source $VIMRUNTIME/mswin.vim
  4:behave mswin
  5:
  6:set diffexpr=MyDiff()
  7:
  8:function MyDiff()
  9:  let opt = '-a --binary '
 10:  if diffopt =~ 'icase' | let opt = opt . '-i ' | endif
 11:  if diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
 12:  let arg1 = v:fname_in
 13:  if arg1 =~ ' ' | let arg1 = '' . arg1 . '' | endif
 14:  let arg2 = v:fname_new
 15:  if arg2 =~ ' ' | let arg2 = '' . arg2 . '' | endif
 16:  let arg3 = v:fname_out
 17:  if arg3 =~ ' ' | let arg3 = '' . arg3 . '' | endif
 18:  let eq = ''
 19:  if $VIMRUNTIME =~ ' '
 20:if sh =~ '\cmd'
 21:  let cmd = '' . $VIMRUNTIME . '\diff'
 22:  let eq = ''
 23:else
 24:  let cmd = substitute($VIMRUNTIME, ' ', ' ', '') . '\diff'
 25:endif
 26:  else
 27:let cmd = $VIMRUNTIME . '\diff'
 28:  endif
 29:  silent execute '!'.cmd.' '.opt.arg1.' '.arg2.'  '.arg3.eq
 30:endfunction
-


-- 
You received this message from the vim_dev 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


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-18 Fir de Conversatie Tony Mechelynck

On 18/03/11 03:11, Steve Hall wrote:

On Thu, 2011-03-17 at 14:33 -0700, Ben Fritz wrote:


I know for quite some time, the diffexpr given in vimrc_example.vim
(or wherever it is given in the default cream setup) is broken on
Windows. Perhaps it still is broken?


First I've heard. Can we not start distributing .vimrc and _vimrc
instead of relying on the installer to create these?

[...]

If we distribute .vimrc and _vimrc, wouldn't that clobber any existing 
user vimrc during an upgrade, the way, let's say, 
$VIMRUNTIME/syntax/vim.vim is overwritten by an upgrade?



Best regards,
Tony.
--
If all be true that I do think,
There be Five Reasons one should Drink;
Good friends, good wine, or being dry,
Or lest we should be by-and-by,
Or any other reason why.

--
You received this message from the vim_dev 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


RE: Cream without cream 7.3.138 gives errors with Diff

2011-03-18 Fir de Conversatie Steve Hall
From: Tony Mechelynck, Fri, March 18, 2011 5:51 am
 On 18/03/11 03:11, Steve Hall wrote:
  
  Can we not start distributing .vimrc and _vimrc instead of relying
  on the installer to create these?
 [...]
 
 If we distribute .vimrc and _vimrc, wouldn't that clobber any
 existing user vimrc during an upgrade, the way, let's say,
 $VIMRUNTIME/syntax/vim.vim is overwritten by an upgrade?

Depends on how it is distributed.

I've always thought it odd that the default vimrc requires any lines
at all. Why is the default behavior of the application required to be
varied by a vimrc? A vimrc is for a user to alter defaults, but as
long as I can remember Vim has distributed one with features differing
by distribution. (Raise your hand if you count 100 times you've seen a
Windows Vim user confused by the mswin line in _vimrc.) And each
installer has to prompt the user whether or not to overwrite the
existing vimrc. On silent installs, OS upgrades, new OS installs,
etc., what should be the default?

IMO, the correct behavior should be an empty vimrc named
vimrc-example. Various features can be included (commented) with
simple explanatory text, like a reference tutorial of the top 100
features most users tamper with. The first line explains how to rename
the file to activate it.

Then all the distributions can include the same file, nobody gets
their customized vimrc clobbered, and the default Vim behavior is the
same for everybody. 


-- 
Steve Hall  [ digitect dancingpaper com ]
:: Cream for Vim (http://cream.sourceforge.net)


-- 
You received this message from the vim_dev 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


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-18 Fir de Conversatie Ben Fritz


On Mar 17, 9:11 pm, Steve Hall digit...@dancingpaper.com wrote:
 On Thu, 2011-03-17 at 14:33 -0700, Ben Fritz wrote:

  I know for quite some time, the diffexpr given in vimrc_example.vim
  (or wherever it is given in the default cream setup) is broken on
  Windows. Perhaps it still is broken?

 First I've heard. Can we not start distributing .vimrc and _vimrc
 instead of relying on the installer to create these?

 Below is the _vimrc generated by the Cream installer, taken from Vim's
 installer years ago. If someone can point out how it differs from the
 current Vim default, I'll fix it.

 --
 Steve Hall  [ digitect dancingpaper com ]

 -
   1:set nocompatible
   2:source $VIMRUNTIME/vimrc_example.vim
   3:source $VIMRUNTIME/mswin.vim
   4:behave mswin
   5:
   6:set diffexpr=MyDiff()
   7:
   8:function MyDiff()
   9:  let opt = '-a --binary '
  10:  if diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  11:  if diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  12:  let arg1 = v:fname_in
  13:  if arg1 =~ ' ' | let arg1 = '' . arg1 . '' | endif
  14:  let arg2 = v:fname_new
  15:  if arg2 =~ ' ' | let arg2 = '' . arg2 . '' | endif
  16:  let arg3 = v:fname_out
  17:  if arg3 =~ ' ' | let arg3 = '' . arg3 . '' | endif
  18:  let eq = ''
  19:  if $VIMRUNTIME =~ ' '
  20:    if sh =~ '\cmd'
  21:      let cmd = '' . $VIMRUNTIME . '\diff'
  22:      let eq = ''
  23:    else
  24:      let cmd = substitute($VIMRUNTIME, ' ', ' ', '') . '\diff'
  25:    endif
  26:  else
  27:    let cmd = $VIMRUNTIME . '\diff'
  28:  endif
  29:  silent execute '!'.cmd.' '.opt.arg1.' '.arg2.'  '.arg3.eq
  30:endfunction
 -

Wow, I thought I'd seen this on the list before. Maybe I was wrong.
Details here:

http://vim.wikia.com/wiki/Running_diff#Vim_distribution_from_Cream

It looks like some changes have been made since the wiki article was
written, I'm not sure if issues remain. It looks like at least the '!'
placement has been fixed.

Perhaps the OP is using the outdated MyDiff documented on the wiki
page.

-- 
You received this message from the vim_dev 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


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-18 Fir de Conversatie Ben Fritz


On Mar 18, 12:35 pm, Ben Fritz fritzophre...@gmail.com wrote:
 On Mar 17, 9:11 pm, Steve Hall digit...@dancingpaper.com wrote:

  On Thu, 2011-03-17 at 14:33 -0700, Ben Fritz wrote:

   I know for quite some time, the diffexpr given in vimrc_example.vim
   (or wherever it is given in the default cream setup) is broken on
   Windows. Perhaps it still is broken?

  First I've heard. Can we not start distributing .vimrc and _vimrc
  instead of relying on the installer to create these?

  Below is the _vimrc generated by the Cream installer, taken from Vim's
  installer years ago. If someone can point out how it differs from the
  current Vim default, I'll fix it.

  --
  Steve Hall  [ digitect dancingpaper com ]

  -
    1:set nocompatible
    2:source $VIMRUNTIME/vimrc_example.vim
    3:source $VIMRUNTIME/mswin.vim
    4:behave mswin
    5:
    6:set diffexpr=MyDiff()
    7:
    8:function MyDiff()
    9:  let opt = '-a --binary '
   10:  if diffopt =~ 'icase' | let opt = opt . '-i ' | endif
   11:  if diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
   12:  let arg1 = v:fname_in
   13:  if arg1 =~ ' ' | let arg1 = '' . arg1 . '' | endif
   14:  let arg2 = v:fname_new
   15:  if arg2 =~ ' ' | let arg2 = '' . arg2 . '' | endif
   16:  let arg3 = v:fname_out
   17:  if arg3 =~ ' ' | let arg3 = '' . arg3 . '' | endif
   18:  let eq = ''
   19:  if $VIMRUNTIME =~ ' '
   20:    if sh =~ '\cmd'
   21:      let cmd = '' . $VIMRUNTIME . '\diff'
   22:      let eq = ''
   23:    else
   24:      let cmd = substitute($VIMRUNTIME, ' ', ' ', '') . '\diff'
   25:    endif
   26:  else
   27:    let cmd = $VIMRUNTIME . '\diff'
   28:  endif
   29:  silent execute '!'.cmd.' '.opt.arg1.' '.arg2.'  '.arg3.eq
   30:endfunction
  -

 Wow, I thought I'd seen this on the list before. Maybe I was wrong.
 Details here:

 http://vim.wikia.com/wiki/Running_diff#Vim_distribution_from_Cream

 It looks like some changes have been made since the wiki article was
 written, I'm not sure if issues remain. It looks like at least the '!'
 placement has been fixed.


...but the backslash issues have not been fixed. Steve, the version
installed on my machine (I always choose to overwrite the _vimrc)
looks like this on line 20:

if sh =~ '\cmd'
  let cmd = '\' . $VIMRUNTIME . '\diff\'
  let eq = '\\'

If I get rid of the extra backslashes so it matches the version you
posted, it works fine. If the backslashes are left in, it breaks as
the OP describes.

-- 
You received this message from the vim_dev 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


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-18 Fir de Conversatie Steve Hall
On Fri, 2011-03-18 at 10:46 -0700, Ben Fritz wrote:
 On Mar 18, 12:35 pm, Ben Fritz fritzophre...@gmail.com wrote:
 
 ...but the backslash issues have not been fixed. Steve, the version
 installed on my machine (I always choose to overwrite the _vimrc)
 looks like this on line 20:
 
 if sh =~ '\cmd'
   let cmd = '\' . $VIMRUNTIME . '\diff\'
   let eq = '\\'
 
 If I get rid of the extra backslashes so it matches the version you
 posted, it works fine. If the backslashes are left in, it breaks as
 the OP describes.

I'll fix this before our next update.

Does the default Vim set diffexpr ? I guess that's probably a good
idea for Windows, most users don't have a diff.exe on path.

-- 
Steve Hall  [ digitect dancingpaper com ]


-- 
You received this message from the vim_dev 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


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-18 Fir de Conversatie James Vega
On Fri, Mar 18, 2011 at 06:26:38AM -0700, Steve Hall wrote:
 From: Tony Mechelynck, Fri, March 18, 2011 5:51 am
  On 18/03/11 03:11, Steve Hall wrote:
   
   Can we not start distributing .vimrc and _vimrc instead of relying
   on the installer to create these?
  [...]
  
  If we distribute .vimrc and _vimrc, wouldn't that clobber any
  existing user vimrc during an upgrade, the way, let's say,
  $VIMRUNTIME/syntax/vim.vim is overwritten by an upgrade?
 
 Depends on how it is distributed.
 
 I've always thought it odd that the default vimrc requires any lines
 at all.

The default vimrc is no vimrc.  There's an example vimrc that the
installer installs to $VIM (which one can change through the Advanced
install options).

Part of the confusion, IMO, is that, on Windows, Vim treats $VIM/_vimrc
as an alternative location for the user's vimrc instead of as the
system-wide vimrc.  So, unlike on unix-like platforms, $VIM/_vimrc is
*only* sourced if $HOME/_vimrc doesn't exist instead of always being
sourced.

The other bit is that the Windows installers (both yours and Bram's),
have decided to use this to, by default, coddle new users by installing
a vimrc to $VIM/_vimrc enabling a bunch of options to make Vim act more
like a typical Windows application.  That may be the right thing to do
for new users, and leave the more experienced users to unselect that
option (as I do) when installing Vim on a new Windows system.  It
depends on what learning curve you want to present to new users.

 Why is the default behavior of the application required to be
 varied by a vimrc? A vimrc is for a user to alter defaults, but as
 long as I can remember Vim has distributed one with features differing
 by distribution. (Raise your hand if you count 100 times you've seen a
 Windows Vim user confused by the mswin line in _vimrc.) And each
 installer has to prompt the user whether or not to overwrite the
 existing vimrc.

The installer should be installing to $VIM, not $HOME.  Unfortunately,
many Windows users aren't used to the concept of $HOME and will tend to
edit the vimrc in $VIM instead of creating their own in $HOME.
Educating the users to put their own vimrc in $HOME is the right route
to avoid it getting overwritten.

 IMO, the correct behavior should be an empty vimrc named
 vimrc-example. Various features can be included (commented) with
 simple explanatory text, like a reference tutorial of the top 100
 features most users tamper with. The first line explains how to rename
 the file to activate it.

Something similar to http://vim.wikia.com/wiki/Example_vimrc, but with
more settings commented out?

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega james...@jamessan.com


signature.asc
Description: Digital signature


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-17 Fir de Conversatie Ben Fritz


On Mar 16, 4:28 pm, Jean Johner jean.joh...@cea.fr wrote:
 Hello,

 I made Cream without cream 7.3.138 vim complete installation on XP.
 Opening a file with gvim and using the menu File/Split Diff with..., I
 get the 2 following error messages:

 E810: Cannot read or write temp files

 then
 E97: Cannot create diffs

 Note that there is no problem with the official gvim73_46.exe
 installation.

 Best regards

 Jean Johner

Also using the Vim without Cream 7.3.138 installation (albeit with my
own custom .vimrc including my own custom diffexpr), I cannot
reproduce this behavior, either using diffsp or using the file menu.

I know for quite some time, the diffexpr given in vimrc_example.vim
(or wherever it is given in the default cream setup) is broken on
Windows. Perhaps it still is broken?

-- 
You received this message from the vim_dev 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


Re: Cream without cream 7.3.138 gives errors with Diff

2011-03-16 Fir de Conversatie Ben Fritz


On Mar 16, 4:28 pm, Jean Johner jean.joh...@cea.fr wrote:
 Hello,

 I made Cream without cream 7.3.138 vim complete installation on XP.
 Opening a file with gvim and using the menu File/Split Diff with..., I
 get the 2 following error messages:

 E810: Cannot read or write temp files

 then
 E97: Cannot create diffs

 Note that there is no problem with the official gvim73_46.exe
 installation.


Does the same thing happen if you use the :diffsplit command instead
of the menu? I installed the same earlier this week on my work
computer and have been using :diffsplit and gvim.exe -d without any
problems.

-- 
You received this message from the vim_dev 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