From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: some small speedups
Date: Mon, 13 Dec 1999 13:27:41 +0100 (MET) [thread overview]
Message-ID: <199912131227.NAA27742@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Mon, 13 Dec 1999 13:01:42 +0100 (MET)
I wrote:
> ...
Damn, sent the wrong patch, use this one instead, please.
Sorry.
Bye
Sven
diff -ru ../z.old/Completion/Builtins/_pids Completion/Builtins/_pids
--- ../z.old/Completion/Builtins/_pids Mon Dec 13 12:47:14 1999
+++ Completion/Builtins/_pids Mon Dec 13 12:48:20 1999
@@ -3,7 +3,7 @@
# If given the `-m <pattern>' option, this tries to complete only pids
# of processes whose command line match the `<pattern>'.
-local list expl match desc listargs args
+local out list expl match desc listargs args
_wanted processes expl 'process ID' || return 1
@@ -12,12 +12,18 @@
shift 2
fi
-zstyle -a ":completion${curcontext}:ps" list-arguments listargs
zstyle -a ":completion${curcontext}:ps" arguments args
-(( $#listargs )) || listargs=( "$args[@]" )
+
+out="$(command ps $args 2>/dev/null)"
if zstyle -t ":completion${curcontext}:processes" verbose; then
- list=("${(@Mr:COLUMNS-1:)${(f@)$(command ps $listargs 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}")
+ zstyle -a ":completion${curcontext}:ps" list-arguments listargs
+ (( $#listargs )) || listargs=( "$args[@]" )
+ if [[ "$listargs" = "$args" ]]; then
+ list=("${(@Mr:COLUMNS-1:)${(f@)out}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}")
+ else
+ list=("${(@Mr:COLUMNS-1:)${(f@)$(command ps $listargs 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}")
+ fi
desc=(-ld list)
else
desc=()
diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files Mon Dec 13 12:47:21 1999
+++ Completion/Core/_path_files Mon Dec 13 12:48:42 1999
@@ -6,7 +6,7 @@
local linepath realpath donepath prepath testpath exppath
local tmp1 tmp2 tmp3 tmp4 i orig pre suf tpre tsuf opre osuf cpre
local pats haspats=no ignore group expl addpfx addsfx remsfx
-local nm=$compstate[nmatches] menu match matcher mopts
+local nm=$compstate[nmatches] menu match matcher mopts atmp
typeset -U prepaths exppaths
@@ -366,12 +366,12 @@
fi
else
if [[ "$tmp3" = */* ]]; then
+ atmp=( -Qf "$mopts[@]" -p "$linepath$tmp4"
+ -W "$prepath$realpath$testpath" "$ignore[@]"
+ "$addpfx[@]" "$addsfx[@]" "$remsfx[@]"
+ -M "r:|/=* r:|=* $match" "$group[@]" "$expl[@]" )
for i in "$tmp1[@]"; do
- compadd -Qf "$mopts[@]" -p "$linepath$tmp4" -s "/${i#*/}" \
- -W "$prepath$realpath$testpath" "$ignore[@]" \
- "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
- -M "r:|/=* r:|=* $match" "$group[@]" "$expl[@]" \
- - "${i%%/*}"
+ compadd "$atmp[@]" -s "/${i#*/}" - "${i%%/*}"
done
else
compadd -Qf "$mopts[@]" -p "$linepath$tmp4" \
diff -ru ../z.old/Completion/Core/compinit Completion/Core/compinit
--- ../z.old/Completion/Core/compinit Mon Dec 13 12:47:21 1999
+++ Completion/Core/compinit Mon Dec 13 12:50:53 1999
@@ -485,13 +485,13 @@
# Default styles. This should be executed conditionally somehow.
-compstyle '*' verbose 'yes'
-compstyle '*' prefix-needed 'yes'
-compstyle '*' prefix-hidden 'no'
-compstyle ':correct' accept '2n'
-compstyle ':correct' prompt 'correct to:'
-compstyle '*' completer '_complete'
-compstyle '*:default' list-colors no=0 fi=0 di=0 ln=0 pi=0 so=0 bd=0 cd=0 ex=0
+zstyle ':completion:*' verbose 'yes'
+zstyle ':completion:*' prefix-needed 'yes'
+zstyle ':completion:*' prefix-hidden 'no'
+zstyle ':completion:correct' accept '2n'
+zstyle ':completion:correct' prompt 'correct to:'
+zstyle ':completion:*' completer '_complete'
+zstyle ':completion*:default' list-colors no=0 fi=0 di=0 ln=0 pi=0 so=0 bd=0 cd=0 ex=0
# Now we automatically make the definition files autoloaded.
diff -ru ../z.old/Completion/User/_cvs Completion/User/_cvs
--- ../z.old/Completion/User/_cvs Mon Dec 13 12:47:25 1999
+++ Completion/User/_cvs Mon Dec 13 12:48:20 1999
@@ -578,7 +578,7 @@
omit=(${pref}*(D:t))
eval 'entries=(${entries:#('${(j:|:)${(@)omit:q}}')})'
_tags directories && compadd "$@" -P "$qpref" - ${entries:q} ||
- _cvs_directories "$@"
+ _cvs_directories "$@"
else
_files "$@"
fi
@@ -595,9 +595,9 @@
omit=($_cvs_ignore_default ${entries:q} ${=cvsignore})
[[ -r ~/.cvsignore ]] && omit=($omit $(<~/.cvsignore))
[[ -r ${pref}.cvsignore ]] && omit=($omit $(<${pref}.cvsignore))
- _files "$@" -g '*~(*/|)('${(j:|:)omit}')(D)' ||
- _files "$@" -g '*~(*/|)('${(j:|:)${(@)entries:q}}')(D)' ||
- _cvs_directories "$@"
+ _path_files "$@" -g '*~(*/|)('${(j:|:)omit}')(D)' ||
+ _path_files "$@" -g '*~(*/|)('${(j:|:)${(@)entries:q}}')(D)' ||
+ _cvs_directories "$@"
else
_files "$@"
fi
diff -ru ../z.old/Completion/User/_pbm Completion/User/_pbm
--- ../z.old/Completion/User/_pbm Mon Dec 13 12:47:29 1999
+++ Completion/User/_pbm Mon Dec 13 12:48:21 1999
@@ -21,7 +21,7 @@
_description files expl 'picture file'
set -- "$expl[@]"
fi
- _files "$@" -g "$pat" || _files "$@" -g '*.(#i)p[bgp]m'
+ _path_files "$@" -g "$pat" || _files "$@" -g '*.(#i)p[bgp]m'
return
fi
@@ -774,5 +774,5 @@
*)
_description files expl 'picture file'
- _files "$expl[@]" -g "$pat" || _files "$expl[@]" -g '*.(#i)p[bgp]m'
+ _path_files "$expl[@]" -g "$pat" || _files "$expl[@]" -g '*.(#i)p[bgp]m'
esac
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-12-13 12:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-13 12:27 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-12-14 10:52 Sven Wischnowsky
1999-12-13 12:38 Sven Wischnowsky
1999-12-13 21:31 ` Peter Stephenson
1999-12-13 12:01 Sven Wischnowsky
1999-12-13 12:21 ` Adam Spiers
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=199912131227.NAA27742@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--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).