From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9783 invoked from network); 25 Jul 2001 12:35:56 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Jul 2001 12:35:56 -0000 Received: (qmail 7580 invoked by alias); 25 Jul 2001 12:35:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15485 Received: (qmail 7567 invoked from network); 25 Jul 2001 12:35:46 -0000 From: Sven Wischnowsky Date: Wed, 25 Jul 2001 14:35:18 +0200 (MET DST) Message-Id: <200107251235.OAA18928@beta.informatik.hu-berlin.de> To: zsh-workers@sunsite.dk Subject: Re: RE: About the new long/short options changes In-Reply-To: <200107251216.OAA18891@beta.informatik.hu-berlin.de> I wrote: > ... > > And since I had to fiddle with this anyway, I also added the > `list-separator' style to make the separator string configurable. Peter > can now set that to `#' (spaces are added automatically). I knew that couldn't be all places... Btw, I use list-colors to make the separator less visible: zstyle ':completion:*:(jobs|directory-stack|indexes)' list-colors \ '=(#b)(*)-- (*)=35;1=31;1=33;1' zstyle ':completion:*:(options|values)' list-colors \ '=(#b)(*)-- (*)=35;1=31;1=33;1' '=*=31;1' (You'll get different and probably very ugly colors with this, for me `35' is a light grey.) Bye Sven Index: Completion/Unix/Command/_lzop =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_lzop,v retrieving revision 1.1 diff -u -r1.1 _lzop --- Completion/Unix/Command/_lzop 2001/04/02 11:56:31 1.1 +++ Completion/Unix/Command/_lzop 2001/07/25 12:34:59 @@ -1,6 +1,6 @@ #compdef lzop -local expl state line decompress disp curcontext="$curcontext" +local expl state line decompress disp curcontext="$curcontext" sep typeset -A opt_args _arguments -C -s \ @@ -91,12 +91,13 @@ fi ;; flags) + zstyle -s ":completion:${curcontext}:flags" list-separator sep || sep=-- disp=( \ - "F -- Append a \`*' for executable files" \ - "G -- Inhibit display of group information" \ - "Q -- Enclose file names in double quotes" ) - disp=( ${disp[@]%[Z$PREFIX] -*} ) + "F $sep Append a \`*' for executable files" \ + "G $sep Inhibit display of group information" \ + "Q $sep Enclose file names in double quotes" ) + disp=( ${disp[@]:#[Z$PREFIX]*} ) compset -P '[FGQ]*' - compadd -d disp - ${disp[@]% -*} + compadd -d disp - ${disp[@]%% *} ;; esac Index: Completion/Zsh/Type/_directory_stack =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_directory_stack,v retrieving revision 1.4 diff -u -r1.4 _directory_stack --- Completion/Zsh/Type/_directory_stack 2001/04/17 09:12:27 1.4 +++ Completion/Zsh/Type/_directory_stack 2001/07/25 12:35:01 @@ -7,11 +7,13 @@ setopt localoptions nonomatch -local expl list lines revlines disp +local expl list lines revlines disp sep ### we decided against this, for now... #! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed || +zstyle -s ":completion:${curcontext}:directory-stack" list-separator sep || sep=-- + [[ $PREFIX = [-+]* ]] || return 1 if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then @@ -24,11 +26,11 @@ integer i revlines=( $lines ) for (( i = 1; i <= $#lines; i++ )); do - lines[$i]="$((i-1)) -- ${revlines[-$i]##[0-9]#[ ]#}" + lines[$i]="$((i-1)) $sep ${revlines[-$i]##[0-9]#[ ]#}" done else for (( i = 1; i <= $#lines; i++ )); do - lines[$i]="$i -- ${lines[$i]##[0-9]#[ ]#}" + lines[$i]="$i $sep ${lines[$i]##[0-9]#[ ]#}" done fi # get the array of numbers only Index: Completion/Zsh/Type/_file_descriptors =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_file_descriptors,v retrieving revision 1.1 diff -u -r1.1 _file_descriptors --- Completion/Zsh/Type/_file_descriptors 2001/04/02 11:19:30 1.1 +++ Completion/Zsh/Type/_file_descriptors 2001/07/25 12:35:01 @@ -1,20 +1,22 @@ #autoload -local i fds expl list link +local i fds expl list link sep for i in {0..9}; [[ -e /dev/fd/$i ]] && fds=( ${fds[@]} $i ) -if zstyle -T ":completion:${curcontext}" verbose && [[ -e /proc/$$/fd ]]; then +if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then + zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-- + if zmodload -e zsh/stat; then for i in "${fds[@]}"; do stat +link -A link /proc/$$/fd/$i - list=( ${list[@]} "$i -- ${link[1]}" ) + list=( ${list[@]} "$i $sep ${link[1]}" ) done elif (( $+commands[readlink] )); then - for i in "${fds[@]}"; list=( ${list[@]} "$i -- $(readlink /proc/$$/fd/$i)" ) + for i in "${fds[@]}"; list=( ${list[@]} "$i $sep $(readlink /proc/$$/fd/$i)" ) else for i in "${fds[@]}"; do - list=( ${list[@]} "$i -- $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" ) + list=( ${list[@]} "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" ) done fi _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds Index: Completion/Zsh/Type/_jobs =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_jobs,v retrieving revision 1.1 diff -u -r1.1 _jobs --- Completion/Zsh/Type/_jobs 2001/04/02 11:17:48 1.1 +++ Completion/Zsh/Type/_jobs 2001/07/25 12:35:04 @@ -1,6 +1,6 @@ #autoload -local expl disp jobs job jids pfx='%' desc how expls +local expl disp jobs job jids pfx='%' desc how expls sep if [[ "$1" = -t ]]; then zstyle -T ":completion:${curcontext}:jobs" prefix-needed && @@ -26,9 +26,10 @@ if [[ -n "$desc" ]]; then disp=() + zstyle -s ":completion:${curcontext}:jobs" list-separator sep || sep=-- for job in "$jids[@]"; do [[ -n "$desc" ]] && - disp=( "$disp[@]" "${pfx}${(r:2:: :)job} -- ${(r:COLUMNS-8:: :)jobtexts[$job]}" ) + disp=( "$disp[@]" "${pfx}${(r:2:: :)job} $sep ${(r:COLUMNS-8:: :)jobtexts[$job]}" ) done fi -- Sven Wischnowsky wischnow@informatik.hu-berlin.de