From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26754 invoked by alias); 7 May 2013 07:38:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31378 Received: (qmail 2165 invoked from network); 7 May 2013 07:38:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.co.uk does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1367912316; bh=VQELFCtKJ71jY82H/kNHLOQDnn78mgXDNpNW4wISXTY=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=C4icvk6gtaZpese6QG3aYIs7v3sT85WN1VDR8wwdUPGNCzgUVJb6bzCjGXEszUEG3kX0/Yn/RtaDX5PlByIZ0+UkHyAZcMLe2/ctIX20Jn//YD+IIldWkL6am+ZOlAxyiyB3CuMnlK9pluefqKq55jqQrdbqPuaknQqb3EfXYjM= X-Yahoo-Newman-Id: 377533.20299.bm@smtp193.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: PJ4xA_IVM1muMsG.RR1Iw.qWy1qVLm2Y5Yd3n5n5TJeu53s OKaD.5a2l.KJbpe8bCEfuIITLzgDRF7foMZV5wBJvIfSfjOp6GjECLeE7D6c ISOW88ZMx9XfBtLg9ferU5g4.4qBnKnfkS294o9B9JtBfXpFhiZOq_O3.zuW oN3henUDxUQv97iJAcgxgO6J5Q6WDOuCA8RrQiUpGMuJrQp5FFS3DPDRmx2V yzBhc2xD7ui1PeTc2ywosLlRDxiCYrqHFGeOVk3c6t13Wi9uhwAkje1OHdSw 6fkoAM49tgk5FbzDZhigqBGB0KvXwBFZaNbnHrq0TM3a9sp1n6bXzzMannc8 ssNPU_D6YIsTWj5.KXw6..QfnvCMd9Dx9TFrwq7GsbgOrXTD_5BwwnDuN8Wr dkkLoS.bsIPAZ.vIXlv4BgbiXIN_BGqcVLaGVLXjMJPVo0A-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- X-Rocket-Received: from kiddle.eu (okiddle@95.222.208.8 with plain) by smtp193.mail.ir2.yahoo.com with SMTP; 07 May 2013 07:38:36 +0000 UTC In-reply-to: <20130504142355.0fdaf612@pws-pc.ntlworld.com> From: Oliver Kiddle References: <20130426123921.GT16210@xvii.vinc17.org> <20130426154427.06972873@pwslap01u.europe.root.pri> <20130426153546.GV16210@xvii.vinc17.org> <20130429095741.7867e358@pwslap01u.europe.root.pri> <19868.1367633701@thecus.kiddle.eu> <20130504142355.0fdaf612@pws-pc.ntlworld.com> To: zsh-workers@zsh.org Subject: Re: Subversion completion don't work with UTF8 (and other) file names Date: Tue, 07 May 2013 09:38:35 +0200 Message-ID: <14778.1367912315@thecus.kiddle.eu> On 4 May, Peter Stephenson wrote: > So that goes back to my previous question, what do we actually need to > change to make it work regardless of locale? For subcommands, lines starting with three spaces works. For changelists, we can use svn status --xml. That breaks if the changelist name needs XML entities (which it only uses for things like &<>") but you can already confuse it with suitably contrived characters, anyway. For everything else, it isn't so easy, mainly because we also match strings like ARG, TARGET, URL etc to find out what to complete after the option or subcommand. And those get translated. If anyone, is tempted to try to get further on this, note that svn 1.7 translates slightly more than 1.6 such as the word "usage". Oliver diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 597f232..014b0ac 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -20,7 +20,7 @@ _svn () { typeset -gHA _svn_cmds if _cache_invalid svn-cmds || ! _retrieve_cache svn-cmds; then _svn_cmds=( - ${=${(f)${${"$(_comp_locale; _call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:} + ${=${${${(M)${(f)"$(_call_program commands svn help)"}:# [a-z]*}//[ )]/}//[(,]/:}/(#m)*/${MATCH%%:*} :$MATCH:} ) _store_cache svn-cmds _svn_cmds fi @@ -157,7 +157,7 @@ _svnadmin () { if [[ -n $state ]] && (( ! $+_svnadmin_cmds )); then typeset -gHA _svnadmin_cmds _svnadmin_cmds=( - ${=${(f)${${"$(_comp_locale; _call_program commands svnadmin help)"#l#*Available subcommands:}}}/(#s)[[:space:]]#(#b)([-a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:} + ${=${${${(M)${(f)"$(_call_program commands svnadmin help)"}:# [a-z]*}//[ )]/}//[(,]/:}/(#m)*/${MATCH%%:*} :$MATCH:} ) fi @@ -319,7 +319,7 @@ _svn_props() { _svn_changelists() { local cls - cls=( ${${${(M)${(f)"$(_comp_locale; _call_program changelists svn status 2>/dev/null)"}:#--- Changelist*}%??}##*\'} ) + cls=( ${${${(M)${(s.<.)"$(_call_program changelists svn status --xml)"}:#changelist*}#*name=?}%%?>*} ) compadd "$@" -a cls && return 0 }