From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5272 invoked by alias); 20 Feb 2014 10:11:40 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18498 Received: (qmail 17994 invoked from network); 20 Feb 2014 10:11:33 -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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1392890761; bh=I3g8/KIZGxu4si4Dl+U9/A7RjDX5CjsXnhW2xNkxI/g=; 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:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=Hr8SIwucbbkgIww3yhtYKpo95iFWBS1PXptAbpUhBeMCDLNYjCFytZwoi9R7wHMmn9Quy9YrjApDaSB15ZHka8acRQSvnwd4lWzeLETpBzP+AWJyREzKI07AkJYcob5gpUA36EWaukqedSgreliLnjTXq1MH9EA4E3rjTSu2xnE= X-Yahoo-Newman-Id: 29623.99266.bm@smtp106.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: vuswJCoVM1nOiSuL9l0AyT1_KGPtqgO_9WTt2wFVY413lnq dH7t1SS_ne6qMYm8cCHBsS0lrMmUZqnNkngliHybGidEOdgrhDnOjOrneHCd JGGsSe7J4.Vb2AZ0rrOofGYwp_z0wgzVnV06Si6uWbGGM3NWxQ01eHHzFUGc 7UVzFRMxkgawX3ifS.ARVjgvovi.axUgcDM2cSRxhmU0YhGVL_1S5gXa0uiy nZibrmnSRl6spJzBUmfAlIlaVXIDtfhBkV29zTviUOfhgbJ3lnk.tKFnJOKs .XTeoTm_bac.pzY6cy6ggZwpnml8wmGx41lKgsF6De3e7ShVN46zI2LIzC5H u5kYkvJ4uf.C9Vd.0IY2V2czgN4ShCU5aCsjQ7glyjh.joixDlBH50sW05y2 P8YoyXstvQeFu6.Io.gn.IoOS3h9NvRAic.Z9urTTyILFbKcGX6t2c7kR.RD WvB8aboG8N1aGdgQxr8ti0a7SJFibjOYPhg2DhaFuKt1EBkcQkdj6ow7iLqt yl.WQFtBX0ywJ61BIDNP9e.s- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- X-Rocket-Received: from kiddle.eu (okiddle@88.153.5.1 with plain [188.125.69.59]) by smtp106.mail.ir2.yahoo.com with SMTP; 20 Feb 2014 10:06:00 +0000 UTC In-reply-to: From: Oliver Kiddle References: <16835.1392415885@thecus.kiddle.eu> To: zsh-users@zsh.org Subject: Re: Remove space added by completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27787.1392890747.1@thecus.kiddle.eu> Date: Thu, 20 Feb 2014 11:05:59 +0100 Message-ID: <27810.1392890759@thecus.kiddle.eu> On 15 Feb, zzapper wrote: > > It might be useful to have a specific example of an unwanted space. > alias -g NF='*~vssver.scc(.om[1])' > ls NF _expand looks at an add-space style to see whether to add a space suffix so it seems logical for _expand_alias to also observe that style. At least only for a true/false value (_expand has special handling for files/directories). Note that _expand_alias is using expand-alias-word in the zstyle context which is perhaps not what you'd first guess. Oliver diff --git a/Completion/Base/Completer/_expand_alias b/Completion/Base/Completer/_expand_alias index 8848e66..8240e41 100644 --- a/Completion/Base/Completer/_expand_alias +++ b/Completion/Base/Completer/_expand_alias @@ -1,7 +1,7 @@ #compdef -K _expand_alias complete-word \C-xa local word expl tmp pre sel what -local -a tmpa +local -a tmpa suf eval "$_comp_setup" @@ -58,7 +58,8 @@ if [[ -n $tmp ]]; then tmp="\\$tmp" fi fi - $pre _wanted aliases expl alias compadd -UQ -- ${tmp%%[[:blank:]]##} + zstyle -T ":completion:${curcontext}:" add-space || suf=( -S '' ) + $pre _wanted aliases expl alias compadd -UQ "$suf[@]" -- ${tmp%%[[:blank:]]##} elif (( $#pre )) && zstyle -t ":completion:${curcontext}:" complete; then $pre _aliases -s "$sel" -S '' else