Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Subversion completion don't work with UTF8 (and other) file names

On 29 Apr, Peter Stephenson wrote:
> > > Unsetting all the LC_* variables (including LC_ALL) and setting only
> > > LC_CTYPE and LANG should be good enough, shouldn't it?  Something like:
> > > 
> > > _comp_locale() {
> > >    # This exports new locale settings, so should only
> > >    # be run in a subshell.  A typical use is in a $(...).
> > >    local ctype=${${(f)"$(locale 2>/dev/null)"}:#^LC_CTYPE=*}
> > >    unset -m LC_\*
> > >    [[ -n $ctype ]] && eval export $ctype
> > >    export LANG=C
> > > }
> > 
> Here's a change for _subversion only, if this works we can expand the
> use.

Is the locale command that portable?.
I'm not sure this is even necessary in the cases where it is just calling
svnadmin help or svn help rather than svn status.

Originally, _subversion set LC_MESSAGES for these commands but LC_ALL
overrides LC_MESSAGES. Would it be better to do it as follows:
  LC_CTYPE=${LC_ALL:-${LC_CTYPE:-$LANG}} LC_ALL= LC_MESSAGES=C _call_program ...

Or should we change the patterns so they'll work even with output in
other languages. For svn status, the changelists are introduced with
lines starting '---' and for svn help, sub commands all start with
three spaces so that may be the best option.


Messages sorted by: Reverse Date, Date, Thread, Author