From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19015 invoked from network); 26 Apr 2008 18:42:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Apr 2008 18:42:20 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 66298 invoked from network); 26 Apr 2008 18:42:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Apr 2008 18:42:16 -0000 Received: (qmail 21758 invoked by alias); 26 Apr 2008 18:42:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24874 Received: (qmail 21743 invoked from network); 26 Apr 2008 18:42:13 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Apr 2008 18:42:13 -0000 Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bifrost.dotsrc.org (Postfix) with ESMTP id C8B85808A38A for ; Sat, 26 Apr 2008 20:42:07 +0200 (CEST) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20080426184620.JTDD19548.mtaout03-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Sat, 26 Apr 2008 19:46:20 +0100 Received: from pws-pc ([81.107.40.67]) by aamtaout03-winn.ispmail.ntl.com with ESMTP id <20080426184918.LTVG26699.aamtaout03-winn.ispmail.ntl.com@pws-pc>; Sat, 26 Apr 2008 19:49:18 +0100 Date: Sat, 26 Apr 2008 19:41:25 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Cc: 478019@bugs.debian.org Subject: Re: Bug#478019: zsh: Should handle non-breaking space as word separator Message-ID: <20080426194125.355685ca@pws-pc> In-Reply-To: <20080426150548.GB6165@scru.org> References: <20080426110003.GA16650@implementation> <20080426150548.GB6165@scru.org> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV 0.91.2/6955/Sat Apr 26 18:30:27 2008 on bifrost X-Virus-Status: Clean On Sat, 26 Apr 2008 16:05:48 +0100 Clint Adams wrote: > On Sat, Apr 26, 2008 at 12:00:03PM +0100, Samuel Thibault wrote: > > On a french keyboard, '|' is typed by using alt-gr, and the non-breaking > > space is often typed by using alt-gr space. That often leads to this: > >=20 > > =E2=82=AC echo a |=C2=A0grep a > > zsh: command not found: =C2=A0grep > >=20 > > Because zsh looks for a "=C2=A0grep" command, with leading non-breaking= space > > because my thumb remained a bit too long on the alt-gr key. > >=20 > > This doesn't happen with bash, because bash treats non-breaking space as > > a word separator. Could zsh do the same? (currently, I have defined > > alias =C2=A0grep=3Dgrep > > alias =C2=A0vi=3Dvi > > ...) >=20 > Having locale-based (and multibyte) word separators sounds like a nightma= re > to me, but maybe someone has some ideas. I tend to agree with this. It's doable, and the standard (SUS 2004) supports the idea (see under LC_CTYPE) although it's a little bit two-faced (only ASCII space characters are listed as requiring quoting, for example). However, - I've been resisting having to convert the byte stream into anything else for basic shell parsing. I've got far better things to do than make the shell slower and buggier for a feature of doubtful general utility. - Having basic syntactic elements depending on the locale is really nasty. We have one such kludge ourselves, (NO_)POSIX_IDENTIFIERS, which is mostly a sop to traditional pre-multibyte zsh behaviour. I would actively discourage people from assuming this sort of behaviour. - It seems to me somewhat ludicrous making a change specifically so that arguments can be separated by a "non-breaking" space. Is it or isn't it breakable? - This isn't a general solution to mistyping anyway. You might be able to fix alt-gr space with xmodmap or the terminal emulator translation table. (Yes, I know "a little bit two-faced" is meaningless, strictly speaking. I stopped speaking strictly years ago now.) --=20 Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/