Jean-François Bignolles wrote:

> I made a new patch (based on vim 7.4.315).
> 
> Le mercredi 28 mai 2014 19:49:50 UTC+2, Bram Moolenaar a écrit :
> 
> > I had a look at this.
> > 
> > First a small remark about the patch: 
> > 
> >     Places for your personal initializations:
> > 
> > -           Unix            $HOME/.vimrc or $HOME/.vim/vimrc
> > +           Unix            $HOME/.vimrc or $HOME/.vim/vimrc;
> > +                           with |+xdg_basedir| feature, it can also be
> > +                           $XDG_CONFIG_HOME/vim/vimrc (first place)
> > 
> > That should be $XDG_CONFIG_HOME/vim, without the /vimrc.
> 
> No. "$XDG_CONFIG_HOME/vim" is a *DIRECTORY*, not a file; it's an alternative
> choice for "$HOME/vim". This documentation extract talks about the "vimrc",
> the main Vim user configuration *FILE*.
> 
> > Problem with making this a compile-time feature is that if the binary is
> > shared with several users, or it's part of a precompiled package,
> > suddenly the user has to put his Vim files elsewhere.  This will quickly
> > lead to two different binaries, so that users can select the one that
> > fits them.
> > 
> > Making this a runtime option is problematic, since the changes are in
> > the default values.
> 
> In the new patch there is no compile-time switch anymore; XDG support is
> always enabled, but in a way where compatibility with non-XDG version is
> preserved.
> 
> > This is far from ideal, I expect it to cause more trouble than it would
> > ever solve.  Who actually uses these $XDG_ variables?
> 
> For end user, defining $XDG_ variables is is optional, not mandatory.
> For the developper wishing to support XDG, interpreting them is a
> requirement: it allows the user to overide default locations.
> That's why special logic is added for $XDG_ variables expansion.
> 
> > Probably the only way is to ADD these $XDG_ directories, after the
> > current directories.  So that they only get used if the old directories
> > do not exist.  Then users getting a new binary will not notice a
> > difference, and are free to move their files to the new location, if
> > that is that they prefer.
> 
> The new patch does this.
> 
> > In practice this probably means users would do:
> >     mv ~/.vim ~/.config/vim
> >     mv ~/.vimrc ~/.config/vim/vimrc
> 
> Exactly.
> 
> So, let's give a short description:
>   - vimrc: "$XDG_CONFIG_HOME/vim/vimrc" is added (3rd choice).
>   - gvimrc: "$XDG_CONFIG_HOME/vim/gvimrc" is added (3rd choice).
>   - viminfo path is unchanged, but the user can use 'viminfo' option.
>   - 'backupdir' and 'directory': "$XDG_CACHE_HOME/vim" is added (2nd choice);
>     if the user doesn't create this directory, Vim behaviour is unchanged.
>   - 'runtimepath': "$XDG_CONFIG_HOME/vim" and "$XDG_CONFIG_HOME/vim/after"
>     are added, but don't replace "$HOME/.vim" and "$HOME/.vim/after".
>   - 'viewdir' is unchanged (since it's a single directory option).

Thanks for the update.  I'm still a bit worried that including this
patch will cause backwards compatibility problems.

I notice you use string concatenation:

 +#define RUNTIME_AFTER   RUNTIME_USER "/after"

Older C compilers do not support this. I'm not sure which ones, it is
not used yet in Vim.

-- 
hundred-and-one symptoms of being an internet addict:
254. You wake up daily with your keyboard printed on your forehead.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui