From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 991 invoked from network); 19 Mar 2000 07:28:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Mar 2000 07:28:27 -0000 Received: (qmail 17977 invoked by alias); 19 Mar 2000 07:28:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10168 Received: (qmail 17959 invoked from network); 19 Mar 2000 07:28:18 -0000 From: "Bart Schaefer" Message-Id: <1000319072813.ZM788@candle.brasslantern.com> Date: Sun, 19 Mar 2000 07:28:13 +0000 X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: PATCH: History and precmd MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Does anybody know of a problem with the following? I suddenly found myself wanting the history number for `print -P %h` and the value of the $history assoc to be up-to-date during precmd(). I used stophist = 3 because it wasn't being used for anything else. If there's some reason that all current values of stophist are powers of 2, I couldn't discover it. Index: Src/init.c =================================================================== @@ -106,12 +106,16 @@ for (;;) { freeheap(); errflag = 0; + hbegin(1); /* init history mech */ if (isset(SHINSTDIN)) { setblock_stdin(); - if (interact) + if (interact) { + int hstop = stophist; + stophist = 3; preprompt(); + stophist = hstop; + } } - hbegin(1); /* init history mech */ intr(); /* interrupts on */ lexinit(); /* initialize lexical state */ if (!(prog = parse_event())) { /* if we couldn't parse a list */ -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com