1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 10:01:11 +02:00

18432: Minor miscellany of comments and rationalisations.

This commit is contained in:
Peter Stephenson 2003-04-03 10:24:40 +00:00
parent 7d4014c30a
commit f713bf4b09
6 changed files with 40 additions and 5 deletions

View file

@ -1,5 +1,12 @@
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
bash-* word functions in favour of selectable ones (18394).

View file

@ -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
# Completion for all possible MH commands.
local mymhdir=${$(_call_program mhpath mhpath + 2>/dev/null):-~/Mail}
local mhlib=/usr/lib/mh
@ -84,7 +83,7 @@ else
compadd "$expl[@]" $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') &&
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
(( ret )) || return 0
done

View file

@ -187,6 +187,18 @@
# command are appended to the remaining words of the style before calling
# 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
# ====
#

View file

@ -374,6 +374,11 @@ noderef(Parameters)
for a description of parameters, including arrays, associative arrays,
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
the pattern is the same as that used for filename generation;
see noderef(Filename Generation). Note that these patterns, along with

View file

@ -75,6 +75,10 @@ if (( ! ${#sessions} )); then
print "No connections to spam." >&2
return 1
fi
if (( ! $# )); then
print "No commands given." >&2
return 1
fi
if [[ -n $transmit ]]; then
cmd=tcp_send

View file

@ -15,16 +15,24 @@ autoload match-words-by-style
local curcontext=":zle:$WIDGET" skip
local -a matched_words
integer count=${NUMERIC:-1}
integer count=${NUMERIC:-1} neg
(( count < 0 )) && (( count = -count, neg = 1 ))
while (( count-- > 0 )); do
match-words-by-style
[[ -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]"
RBUFFER="${(j..)matched_words[6,7]}"
RBUFFER="${(j..)matched_words[6,7]}"
fi
done