From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26336 invoked by alias); 24 Sep 2010 14:26:58 -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: 28291 Received: (qmail 1866 invoked from network); 24 Sep 2010 14:26:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Fri, 24 Sep 2010 15:26:18 +0100 From: Peter Stephenson To: Zsh Workers Subject: Re: !!$ unitialized at first prompt Message-ID: <20100924152618.036db8d0@pwslap01u.europe.root.pri> In-Reply-To: References: <20100924133936.245765b2@pwslap01u.europe.root.pri> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; i686-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 24 Sep 2010 14:26:18.0720 (UTC) FILETIME=[740ABE00:01CB5BF4] X-Scanned-By: MailControl A-10-90-03 (www.mailcontrol.com) on 10.71.0.139 On Fri, 24 Sep 2010 10:18:23 -0400 (EDT) "Benjamin R. Haskell" wrote: > On Fri, 24 Sep 2010, Peter Stephenson wrote: > > > The shell doesn't split words in the same way when importing > > history. In normal operation it relies on the lines having been > > passed through the lexical analyser to generate the words, which > > doesn't happen when history is read from a file. Instead it just > > blindly splits on whitespace. > > Interesting. > > I'm surprised it splits the history when it's read in. (I would've > expected it to read in whole command lines and only split into words > when necessary.) There isn't a "when necessary", exactly: what's recorded in the history list are the word pointers, which is what you get for free (well, OK, for me spending a few hours a few years ago improving the mechanism, which used to record words in a slightly messier way) when they've come from "live" history. So, without adding additional complexity, doing it on reading in is the only sensible place in the other case (what it happens to do at that point is a different matter but if you've seen the completion system you'll realise interfacing to the lexical analyser just to split up words isn't much fun with our current implementation). -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom