From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1130 invoked from network); 19 Apr 2005 23:02:00 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?UkEn93U0Hpc1l9s9CUB6alsn/RZlc48z?@203.24.36.3) by ns1.primenet.com.au with (DHE-RSA-AES256-SHA encrypted) SMTP; 19 Apr 2005 23:02:00 -0000 Received: (qmail 5920 invoked from network); 19 Apr 2005 21:01:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by proxy.melb.primenet.com.au with SMTP; 19 Apr 2005 21:01:09 -0000 Received: (qmail 30902 invoked from network); 19 Apr 2005 21:01:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Apr 2005 21:01:03 -0000 Received: (qmail 6976 invoked by alias); 19 Apr 2005 21:00:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21157 Received: (qmail 6951 invoked from network); 19 Apr 2005 21:00:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Apr 2005 21:00:57 -0000 Received: (qmail 30585 invoked from network); 19 Apr 2005 21:00:57 -0000 Received: from mail.visit.se (HELO davinci.visit.se) (212.214.126.18) by a.mx.sunsite.dk with SMTP; 19 Apr 2005 21:00:53 -0000 Received: from haugen.visit.se (haugen.visit.se [212.214.112.43]) by davinci.visit.se (8.12.8/8.11.2) with ESMTP id j3JKuXir006538 for ; Tue, 19 Apr 2005 22:56:33 +0200 Received: by haugen.visit.se (Postfix, from userid 1000) id 1895216E988; Tue, 19 Apr 2005 22:59:29 +0200 (CEST) To: zsh-workers@sunsite.dk Subject: PATCH for _diff_options to allow argument to -u From: Ulrik Haugen Date: Tue, 19 Apr 2005 22:59:29 +0200 Message-ID: <87is2i1o0e.fsf@haugen.visit.se> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hello! I recently discovered that you can control the amount of context that diff -u or -c gives you. Shortly thereafter it became very annoying that the zsh completion sees characters (other than other option characters) immediately following -u (or -c) as the original file name and thus won't complete the new file once you get as far as "diff -u0 orig". The patch below makes the completion treat them the same way the option handling in diff does. This leaves the completion still thinking A is the original file name if you type for instance "diff -wA orig" whereas diff complains that A is an invalid option, but since diff will make you retype the command anyway it's not necessarily worth fixing. --- /usr/share/zsh/4.2.5/functions/Completion/Unix/_diff_options 2005-04-06 17:30:29.000000000 +0200 +++ init/zshfunctions/_diff_options 2005-03-25 01:09:27.000000000 +0100 @@ -56,4 +56,2 @@ - "($of $oss)"{-C+,--context=-}'[output a context diff]:number of lines of copied context' \ - "($of $oss)-c[output a context diff]" \ - "($of $oss)"{-U+,--unified=-}'[output a unified diff]:number of lines of unified context' \ - "($of $oss)-u[output a unified diff]" \ + "($of $oss)"{-c-,-C+,--context=-}'[output a context diff]:number of lines of copied context' \ + "($of $oss)"{-u-,-U+,--unified=-}'[output a unified diff]:number of lines of unified context' \