mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 10:41:11 +02:00
18432: Minor miscellany of comments and rationalisations.
This commit is contained in:
parent
7d4014c30a
commit
f713bf4b09
6 changed files with 40 additions and 5 deletions
|
@ -1,5 +1,12 @@
|
||||||
2003-04-03 Peter Stephenson <pws@csr.com>
|
2003-04-03 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 18432: Completion/Unix/Command/_mh,
|
||||||
|
Completion/Unix/Command/_perforce, Doc/Zsh/expn.yo,
|
||||||
|
Functions/TCP/tcp_spam, Functions/Zle/transpose-words-match:
|
||||||
|
miscellany: use _path_files for more control in _mh; check
|
||||||
|
arguments in tcp_spam; handle negative prefix arguments in
|
||||||
|
transpose-words-match; a few comments elsewhere.
|
||||||
|
|
||||||
* unposted: Functions/Zle/.distfiles, Functions/Zle/bash-*: remove
|
* unposted: Functions/Zle/.distfiles, Functions/Zle/bash-*: remove
|
||||||
bash-* word functions in favour of selectable ones (18394).
|
bash-* word functions in favour of selectable ones (18394).
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#compdef ali dist flist flists folder folders forw comp inc mark refile repl scan show next prev packf rmf rmm pick whom mhn mhpath mhlist mhstore mhshow mhparam mhmail
|
#compdef ali dist flist flists folder folders forw comp inc mark refile repl scan show next prev packf rmf rmm pick whom mhn mhpath mhlist mhstore mhshow mhparam mhmail
|
||||||
|
|
||||||
# Completion for all possible MH commands.
|
# Completion for all possible MH commands.
|
||||||
|
|
||||||
local mymhdir=${$(_call_program mhpath mhpath + 2>/dev/null):-~/Mail}
|
local mymhdir=${$(_call_program mhpath mhpath + 2>/dev/null):-~/Mail}
|
||||||
local mhlib=/usr/lib/mh
|
local mhlib=/usr/lib/mh
|
||||||
|
|
||||||
|
@ -84,7 +83,7 @@ else
|
||||||
compadd "$expl[@]" $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') &&
|
compadd "$expl[@]" $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') &&
|
||||||
ret=0
|
ret=0
|
||||||
compadd "$expl[@]" reply next cur prev first last all unseen && ret=0
|
compadd "$expl[@]" reply next cur prev first last all unseen && ret=0
|
||||||
_files "$expl[@]" -W folddir -g '<->' && ret=0
|
_path_files "$expl[@]" -W folddir -g '<->' && ret=0
|
||||||
done
|
done
|
||||||
(( ret )) || return 0
|
(( ret )) || return 0
|
||||||
done
|
done
|
||||||
|
|
|
@ -187,6 +187,18 @@
|
||||||
# command are appended to the remaining words of the style before calling
|
# command are appended to the remaining words of the style before calling
|
||||||
# the command.
|
# the command.
|
||||||
#
|
#
|
||||||
|
# Programmes taking p4-style arguments
|
||||||
|
# ====================================
|
||||||
|
#
|
||||||
|
# It is possible to use the _perforce completion with other commands
|
||||||
|
# which behave like a subcommand of p4 by setting the service type
|
||||||
|
# to p4-<subcommand>. For example,
|
||||||
|
# compdef _perforce p4cvsmap=p4-files
|
||||||
|
# says that the command `p4cvsmap' takes arguments like `p4 files'.
|
||||||
|
# Often the options will be different; if this is a problem, you
|
||||||
|
# will need to write your own completer which loads _perforce and
|
||||||
|
# calls its functions directly.
|
||||||
|
#
|
||||||
# TODO
|
# TODO
|
||||||
# ====
|
# ====
|
||||||
#
|
#
|
||||||
|
|
|
@ -374,6 +374,11 @@ noderef(Parameters)
|
||||||
for a description of parameters, including arrays, associative arrays,
|
for a description of parameters, including arrays, associative arrays,
|
||||||
and subscript notation to access individual array elements.
|
and subscript notation to access individual array elements.
|
||||||
|
|
||||||
|
Note in particular the fact that words of unquoted parameters are not
|
||||||
|
automatically split on whitespace unless the option tt(SH_WORD_SPLIT) is
|
||||||
|
set; see references to this option below for more details. This is an
|
||||||
|
important difference from other shells.
|
||||||
|
|
||||||
In the expansions discussed below that require a pattern, the form of
|
In the expansions discussed below that require a pattern, the form of
|
||||||
the pattern is the same as that used for filename generation;
|
the pattern is the same as that used for filename generation;
|
||||||
see noderef(Filename Generation). Note that these patterns, along with
|
see noderef(Filename Generation). Note that these patterns, along with
|
||||||
|
|
|
@ -75,6 +75,10 @@ if (( ! ${#sessions} )); then
|
||||||
print "No connections to spam." >&2
|
print "No connections to spam." >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
if (( ! $# )); then
|
||||||
|
print "No commands given." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n $transmit ]]; then
|
if [[ -n $transmit ]]; then
|
||||||
cmd=tcp_send
|
cmd=tcp_send
|
||||||
|
|
|
@ -15,16 +15,24 @@ autoload match-words-by-style
|
||||||
|
|
||||||
local curcontext=":zle:$WIDGET" skip
|
local curcontext=":zle:$WIDGET" skip
|
||||||
local -a matched_words
|
local -a matched_words
|
||||||
integer count=${NUMERIC:-1}
|
integer count=${NUMERIC:-1} neg
|
||||||
|
|
||||||
|
(( count < 0 )) && (( count = -count, neg = 1 ))
|
||||||
|
|
||||||
while (( count-- > 0 )); do
|
while (( count-- > 0 )); do
|
||||||
match-words-by-style
|
match-words-by-style
|
||||||
|
|
||||||
[[ -z "$matched_words[2]$matched_words[5]" ]] && return 1
|
[[ -z "$matched_words[2]$matched_words[5]" ]] && return 1
|
||||||
|
|
||||||
LBUFFER="$matched_words[1]$matched_words[5]${(j..)matched_words[3,4]}\
|
if (( neg )); then
|
||||||
|
LBUFFER="$matched_words[1]"
|
||||||
|
RBUFFER="$matched_words[5]${(j..)matched_words[3,4]}\
|
||||||
|
$matched_words[2]${(j..)matched_words[6,7]}"
|
||||||
|
else
|
||||||
|
LBUFFER="$matched_words[1]$matched_words[5]${(j..)matched_words[3,4]}\
|
||||||
$matched_words[2]"
|
$matched_words[2]"
|
||||||
RBUFFER="${(j..)matched_words[6,7]}"
|
RBUFFER="${(j..)matched_words[6,7]}"
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue