From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8228 invoked from network); 17 Jul 2000 08:57:46 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Jul 2000 08:57:46 -0000 Received: (qmail 21605 invoked by alias); 17 Jul 2000 08:57:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12270 Received: (qmail 21597 invoked from network); 17 Jul 2000 08:57:38 -0000 Date: Mon, 17 Jul 2000 09:57:12 +0100 From: Peter Stephenson Subject: Re: spaceflag question; remhist() going away In-reply-to: "Your message of Sun, 16 Jul 2000 18:54:27 PDT." To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FXU00DDP3JBWG@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT Wayne wrote: > There's a variable that gets set in input.c called "spaceflag". It > gets set if the first character of the first line is a space. Later > on, the history code checks this flag when the HIST_IGNORE_SPACE > option is set. Can anyone tell me why the history code doesn't just > check if (*chline == ' ') instead of checking spaceflag? ... > In a related area, I've dumped the function remhist() in my local > source. This function is a constant source of bugs, and I found > yet another bug today: if you have HIST_IGNORE_SPACE set along > with HIST_NO_STORE, you lose a line of history every time you type > " history" (note the leading space). The history of history is hidden in prehistory. It's probably best to remove this stuff and then fix the problems which turn up later. I've always hated remhist() and have fixed at least two bugs in it without counting everyone else's. One possible reason for spaceflag might be that originally zsh kept lexical and literal history separately so might not have known if the first word began with a space. But as far as I know chline has always been there, so that's probably wrong. -- Peter Stephenson Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070