From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14600 invoked from network); 13 Oct 2003 17:20:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Oct 2003 17:20:04 -0000 Received: (qmail 6628 invoked by alias); 13 Oct 2003 17:19:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19185 Received: (qmail 6576 invoked from network); 13 Oct 2003 17:19:56 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Oct 2003 17:19:56 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Oct 2003 17:19:56 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.cambridgesiliconradio.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Mon, 13 Oct 2003 18:18:14 +0100 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 13 Oct 2003 18:20:12 +0100 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: delete-word does not delete the entire word... In-reply-to: "Bart Schaefer"'s message of "Mon, 13 Oct 2003 16:49:45 -0000." <1031013164945.ZM20594@candle.brasslantern.com> Date: Mon, 13 Oct 2003 18:19:36 +0100 Message-ID: <20086.1066065576@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 13 Oct 2003 17:20:12.0609 (UTC) FILETIME=[42B65B10:01C391AE] Bart Schaefer wrote: > One question: > > } +local curcontext=:zle:delete-whole-word > > Wouldn't > > local curcontext=:zle:$WIDGET > or > local curcontext=:zle:${WIDGET%-match} > > be better? Yes. The former is how all the others work. Talking of underwhelming responses :-), did anyone ever look at the additions I posted to match-words-by-style which would allow you to have different subcontexts in different bits of the command line? The one where you could do zstyle ':zle:*' word-context "[[:space:]]" whitespace "*/*" \ filename "" end "*" other zstyle ':zle:transpose-words:whitespace' word-style shell zstyle ':zle:transpose-words:filename' word-style normal zstyle ':zle:transpose-words:filename' word-chars '' Anyway, I'm not happy with this; I think there must be a better way of picking context. For example, instead of putting the onus on the user to pick out the contexts, it would probably be more natural simply to extend the existing contexts. Perhaps something like ":" or "::" where context is just an alphanumeric string would carry more information. In other words, word-context would go and the other styles would look like zstyle ':zle:transpose-words:between:<->:*' word-style shell zstyle ':zle:transpose-words:word:<->:*/*' word-style normal zstyle ':zle:transpose-words:word:<->:*/*' word-chars '' where that third word would be a set like empty an empty line before the unusual case of whitespace before any text word a shell word, matched by the last element of the style between whitespace between words (next arg is number of word before) end after all words and the fourth word could be e.g. 1 or <2-> to pick the command word or not the command word. Half an input is better than no bread. Index: Functions/Zle/delete-whole-word-match =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/Zle/delete-whole-word-match,v retrieving revision 1.1 diff -u -r1.1 delete-whole-word-match --- Functions/Zle/delete-whole-word-match 13 Oct 2003 16:50:19 -0000 1.1 +++ Functions/Zle/delete-whole-word-match 13 Oct 2003 17:05:19 -0000 @@ -11,7 +11,7 @@ emulate -L zsh setopt extendedglob -local curcontext=:zle:delete-whole-word +local curcontext=:zle:$WIDGET local -a matched_words # Start and end of range of characters to remove. integer pos1 pos2 -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** 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. **********************************************************************