From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10920 invoked from network); 9 Jul 2003 13:59:51 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Jul 2003 13:59:51 -0000 Received: (qmail 8610 invoked by alias); 9 Jul 2003 13:59:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18839 Received: (qmail 8601 invoked from network); 9 Jul 2003 13:59:46 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 9 Jul 2003 13:59:46 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 9 Jul 2003 13:59:46 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.cambridgesiliconradio.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Tue, 8 Jul 2003 14:59:14 +0100 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 9 Jul 2003 14:58:49 +0100 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: _nice Date: Wed, 09 Jul 2003 14:59:43 +0100 Message-ID: <12734.1057759183@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 09 Jul 2003 13:58:49.0093 (UTC) FILETIME=[38B82350:01C34622] A while ago, someone complained that options following nice weren't taken account of in completion. While I'm waiting for a backup to restore, here is a basic implementation. I haven't handled offering the options for nice, which requires subtlety involving contexts and prefix-needed and so on. Strictly, I don't think it should test for +<-> since that's only for the csh builtin. Index: Completion/Unix/Command/_nice =================================================================== RCS file: Completion/Unix/Command/_nice diff -N Completion/Unix/Command/_nice --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Completion/Unix/Command/_nice 9 Jul 2003 13:56:26 -0000 @@ -0,0 +1,14 @@ +#compdef nice + +shift words +(( CURRENT-- )) + +if [[ $CURRENT -gt 1 && $words[1] = [-+]<-> ]]; then + shift words + (( CURRENT -- )) +elif [[ $CURRENT -gt 2 && $words[1] = -n ]]; then + shift 2 words + (( CURRENT -= 2 )) +fi + +_normal Index: Completion/Zsh/Command/_precommand =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Command/_precommand,v retrieving revision 1.1 diff -u -r1.1 _precommand --- Completion/Zsh/Command/_precommand 2 Apr 2001 11:25:26 -0000 1.1 +++ Completion/Zsh/Command/_precommand 9 Jul 2003 13:56:26 -0000 @@ -1,4 +1,4 @@ -#compdef - nohup nice eval time rusage noglob nocorrect exec +#compdef - nohup eval time rusage noglob nocorrect exec shift words (( CURRENT-- )) -- 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. **********************************************************************