From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: Re: RE: About the new long/short options changes
Date: Wed, 25 Jul 2001 14:35:18 +0200 (MET DST) [thread overview]
Message-ID: <200107251235.OAA18928@beta.informatik.hu-berlin.de> (raw)
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
next prev parent reply other threads:[~2001-07-25 12:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-20 5:01 Bart Schaefer
2001-07-20 7:38 ` Sven Wischnowsky
2001-07-20 9:26 ` Bart Schaefer
2001-07-20 9:43 ` Andrej Borsenkow
2001-07-25 8:49 ` Sven Wischnowsky
2001-07-25 9:15 ` Borsenkow Andrej
2001-07-25 9:20 ` Sven Wischnowsky
2001-07-25 9:24 ` Borsenkow Andrej
2001-07-25 10:13 ` Peter Stephenson
2001-07-25 10:43 ` Sven Wischnowsky
2001-07-25 11:36 ` Borsenkow Andrej
2001-07-25 12:16 ` Sven Wischnowsky
2001-07-25 12:35 ` Sven Wischnowsky [this message]
2001-07-25 17:49 ` Bart Schaefer
2001-07-27 12:53 ` Sven Wischnowsky
2001-07-30 8:22 ` Sven Wischnowsky
2001-07-30 8:38 ` Sven Wischnowsky
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=200107251235.OAA18928@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.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).