From: Peter Stephenson <pws@cambridgesiliconradio.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: PATCH: compinstall menu select
Date: Mon, 22 May 2000 18:49:17 +0100 [thread overview]
Message-ID: <0FUZ00C3A2U5BH@la-la.cambridgesiliconradio.com> (raw)
This allows you to have select=long-list together with select=<num>. 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<num>, 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 <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070
reply other threads:[~2000-05-22 17:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0FUZ00C3A2U5BH@la-la.cambridgesiliconradio.com \
--to=pws@cambridgesiliconradio.com \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).