From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5096 invoked from network); 22 May 2000 17:49:56 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 May 2000 17:49:56 -0000 Received: (qmail 24790 invoked by alias); 22 May 2000 17:49:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11516 Received: (qmail 24781 invoked from network); 22 May 2000 17:49:45 -0000 Date: Mon, 22 May 2000 18:49:17 +0100 From: Peter Stephenson Subject: PATCH: compinstall menu select To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FUZ00C3A2U5BH@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT This allows you to have select=long-list together with select=. As far as I can see those are the only cases you would want together. But I'm inaccurate. Index: Completion/Core/compinstall =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/compinstall,v retrieving revision 1.13 diff -u -r1.13 compinstall --- Completion/Core/compinstall 2000/05/15 12:51:59 1.13 +++ Completion/Core/compinstall 2000/05/22 17:47:01 @@ -233,7 +233,8 @@ print "Completion directories $compdir/* are already in your \$fpath, good." else - print "Completion directory $compdir is already in your \$fpath, good." + print "Completion directory $compdir +is already in your \$fpath, good." fi if [[ -n $fpath_line ]]; then print "I shall keep the existing \$fpath=( ... ) assignment." @@ -1241,6 +1242,7 @@ __ci_do_selection() { local key listc menu select amenu elt + integer num __ci_get_this_style list-colors listc __ci_get_this_style menu menu @@ -1307,17 +1309,18 @@ - 0 or 1, to turn this feature on unconditionally - a higher number to turn this feature on when there are that many completions -- an \`l' for \`long' to turn it on for completions which don't fit on the - screen +- an \`l' for \`long' to turn it on for listings which don't fit on the + screen. - an \`ll' for \`long list' to turn it on for completions which don't fit on the screen, even for commands which only do listing of completions. + This may be combined with a number which will be used in ordinary selection. - a negative number to turn this feature off - an empty line to leave the setting the way it is. " while true; do vared -eh -p 'value> ' select - [[ -z $select || $select = ((-|)<->|l#) ]] && break; - print "Type a number, l, ll, or an empty line." >&2 + [[ -z $select || $select = ((-|)<->|l|<->#ll<->#) ]] && break; + print "Type a number, l, ll, ll, or an empty line." >&2 done amenu=(${=menu}) elt=${amenu[(i)*select*]} @@ -1330,15 +1333,20 @@ fi menu="$amenu" ;; - l#) if [[ $select = l ]]; then - select=long - else - select=long-list - fi - if [[ -n $elt ]]; then - amenu[$elt]="select=$select" + *ll*) num=${(RS)select##ll} + select="select=long-list" + [[ -n $num ]] && select="$select select=$num" + if [[ -n $elt ]]; then + amenu[$elt]=$select + else + amenu=($amenu $select) + fi + menu="$amenu" + ;; + l#) if [[ -n $elt ]]; then + amenu[$elt]="select=long" else - amenu=($amenu "select=$select") + amenu=($amenu "select=long") fi menu="$amenu" ;; -- Peter Stephenson Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070