From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3896 invoked from network); 16 Oct 2005 07:52:43 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?L5Z2kdTuaWHOSSFwU7DEbSlEV31JK/Iu?@203.24.36.3) by ns1.primenet.com.au with (DHE-RSA-AES256-SHA encrypted) SMTP; 16 Oct 2005 07:52:43 -0000 Received: (qmail 18846 invoked from network); 15 Oct 2005 10:48:50 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by proxy.melb.primenet.com.au with SMTP; 15 Oct 2005 10:48:50 -0000 Received: (qmail 6959 invoked from network); 15 Oct 2005 10:47:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Oct 2005 10:47:37 -0000 Received: (qmail 16161 invoked by alias); 15 Oct 2005 10:47:29 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9501 Received: (qmail 16150 invoked from network); 15 Oct 2005 10:47:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 Oct 2005 10:47:28 -0000 Received: (qmail 6012 invoked from network); 15 Oct 2005 10:47:28 -0000 Received: from her-isrv.ionific.com (195.197.252.67) by a.mx.sunsite.dk with SMTP; 15 Oct 2005 10:47:27 -0000 Received: from her-gw.ionific.com ([195.197.252.66] helo=trews52.bothi.fi) by her-isrv.ionific.com with esmtp (Exim 3.35 #1 (Debian)) id 1EQjZW-0002Yr-00 for ; Sat, 15 Oct 2005 13:47:26 +0300 Received: from azure by trews52.bothi.fi with local (Exim 3.36 #1 (Debian)) id 1EQjZN-0000x5-00 for ; Sat, 15 Oct 2005 13:47:17 +0300 To: Zsh Users' List Subject: Superfluous CRs trouble completion routines in Cygwin Mail-copies-to: nobody From: Hannu Koivisto Date: Sat, 15 Oct 2005 13:47:07 +0300 Message-ID: <87irvzys44.fsf@trews52.bothi.fi> User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.4 (i386-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Hannu Koivisto X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 Greetings, I recently needed to use Perforce both in Windows and Linux (zsh 4.2.4 and 4.2.5, respectively). Completion worked fine in Linux but in Windows p4 caused just an odd "display glitch" instead of producing a list of p4 commands and their descriptions. I immediately suspected that the completion code runs p4 to generate the completions and is somehow affected by the carriage returns at the end of lines. And indeed, when I added hline[-1]=${hline[-1]%^M} to the loop _perforce_call_p4 help-commands help commands | while read -A hline; do ... done the problem disappeared. That loop collects the commands and their descriptions into an array which is later passed to _describe. My modification of course fixed this particular case, but I can't help thinking there must be other similar cases in _perforce and probably other completion functions. I wonder if it made sense to make the "core" completion functions such as _describe more tolerant to CRs instead of modifying application-specific completion functions? Or can you think of other, better ways of getting rid of the problem for good? -- Hannu