From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14291 invoked by alias); 29 Jan 2012 21:05:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30153 Received: (qmail 11092 invoked from network); 29 Jan 2012 21:05:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gO8dR29IQD84QuYrneRb1sfYBeyXzOAJ6vSpJwKCbHw=; b=QmshFP1uu0Y2AeKa/Xqiu19dUNNbwfDFrWrkvLDh9xfFQhrJ6b8IOhpZM5/2VbYRGo blJPOmN0iDYbZZ0BxQT40RLZ2Q73Nk+QEG49x75pecQcwj3Tx828PiizUE9rAIfZvKtH GnEGIuhIOurgnhC3/NtIcRT4pWAYqp8TS5Lgg= MIME-Version: 1.0 In-Reply-To: <20120129203031.6ec592d2@pws-pc.ntlworld.com> References: <20120129183838.GF3663@xvii.vinc17.org> <20120129190113.GG3663@xvii.vinc17.org> <20120129203031.6ec592d2@pws-pc.ntlworld.com> Date: Sun, 29 Jan 2012 22:05:12 +0100 Message-ID: Subject: Re: Bug with bash emulation regarding ':' From: Mikael Magnusson To: Peter Stephenson Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 29 January 2012 21:30, Peter Stephenson wrote: > On Sun, 29 Jan 2012 20:01:13 +0100 > Vincent Lefevre wrote: >> On 2012-01-29 19:53:51 +0100, Mikael Magnusson wrote: >> > On 29 January 2012 19:38, Vincent Lefevre wrote: >> > > On 2012-01-29 15:25:13 +0100, Mikael Magnusson wrote: >> > >> On 29 January 2012 14:44, Felipe Contreras wrote: >> > >> > emulate bash >> > >> >> > >> There's no such emulation mode. >> > > >> > > I think the problem is that "emulate" doesn't return an error >> > > if the argument is unsupported. >> > >> > Well, there are no unsupported arguments, anything that isn't >> > recognized is documented (although not accurately) to enter zsh mode >> > :). >> >> Yes, but this is not intuitive. An error would be better, IMHO. > > emulate "bash" is treated as emulate "sh", but isn't so documented. > > However, having any random emulation treated as zsh in the emulate > command seems a bit pointless. I think it only does that because the > code is shared with what happens at shell start-up. > > How about the following compromise? > > - Behave the same at start-up as always. There's no point in an > error here if we don't recognise what zsh is supposed to be emulating. > > - In the emulate command, keep the behaviour that we only test the > initial letter (and that "b" is like "s"), but document it. > > - However, if the initial letter isn't recognised within the emulate > command (i.e. we now require a 'z' for native mode), complain. > > This will annoy anyone who deliberately used "emulate native" to enter > zsh mode (for which I have only limited sympathy), but unless I've > missed something it should keep everyone else happy; indeed, the emulate > command only lists the explicit possibilities "zsh", "sh", "ksh", "csh", > but we did document that zsh was used as a default. Usually Bart spots > something I've missed at this point, however. I noticed that the 'Compatibility' section referred to only talks about ksh and sh emulation, not csh, and it doesn't mention emulating sh when the first letter is b either. -- Mikael Magnusson