From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26258 invoked from network); 3 Apr 2003 10:17:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Apr 2003 10:17:04 -0000 Received: (qmail 2173 invoked by alias); 3 Apr 2003 10:16:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18432 Received: (qmail 2164 invoked from network); 3 Apr 2003 10:16:26 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 3 Apr 2003 10:16:26 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 3 Apr 2003 10:16:26 -0000 Received: from exchange01.csr.com (unverified) by (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Thu, 3 Apr 2003 11:24:48 +0100 Received: from csr.com (tinky-winky.csr.com [192.168.144.127]) by exchange01.csr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id H5TX1AA6; Thu, 3 Apr 2003 11:15:29 +0100 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Minor stuff Date: Thu, 03 Apr 2003 11:16:23 +0100 Message-ID: <29522.1049364983@csr.com> From: Peter Stephenson Some minor things I've never got around to posting or committing, mostly just comments, plus a change in _mh I obviously thought was a good idea some time ago. It also adds negative argument handling to transpose-words-match. The last thing I have sitting around is the proposed change to match-words-by-style for contextual word matching. Did anybody try this? I won't commit it unless there's some agreement. However, I may change the *-match functions so that the style ends in a `:' if there's no subcontext, to be consistent with completion and for whenever we decide how subcontexts work. Then I'll produce 4.1.1-test-1. (This screws up is-at-least, since it's actually before 4.1.1, but I can't help that.) Index: Completion/Unix/Command/_mh =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_mh,v retrieving revision 1.2 diff -u -r1.2 _mh --- Completion/Unix/Command/_mh 10 Mar 2003 15:16:54 -0000 1.2 +++ Completion/Unix/Command/_mh 3 Apr 2003 10:12:01 -0000 @@ -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 @@ 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 Index: Completion/Unix/Command/_perforce =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_perforce,v retrieving revision 1.4 diff -u -r1.4 _perforce --- Completion/Unix/Command/_perforce 12 Mar 2003 12:04:52 -0000 1.4 +++ Completion/Unix/Command/_perforce 3 Apr 2003 10:12:01 -0000 @@ -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-. 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 # ==== # Index: Doc/Zsh/expn.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v retrieving revision 1.43 diff -u -r1.43 expn.yo --- Doc/Zsh/expn.yo 5 Aug 2002 12:33:28 -0000 1.43 +++ Doc/Zsh/expn.yo 3 Apr 2003 10:12:02 -0000 @@ -374,6 +374,11 @@ 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 Index: Functions/TCP/tcp_spam =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/TCP/tcp_spam,v retrieving revision 1.2 diff -u -r1.2 tcp_spam --- Functions/TCP/tcp_spam 23 Feb 2003 23:24:32 -0000 1.2 +++ Functions/TCP/tcp_spam 3 Apr 2003 10:12:02 -0000 @@ -75,6 +75,10 @@ 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 Index: Functions/Zle/transpose-words-match =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/Zle/transpose-words-match,v retrieving revision 1.1 diff -u -r1.1 transpose-words-match --- Functions/Zle/transpose-words-match 28 Mar 2003 11:34:30 -0000 1.1 +++ Functions/Zle/transpose-words-match 3 Apr 2003 10:12:02 -0000 @@ -15,16 +15,24 @@ 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 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************