From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10396 invoked by alias); 23 Feb 2010 07:57:53 -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: 27750 Received: (qmail 7628 invoked from network); 23 Feb 2010 07:57:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED autolearn=ham version=3.2.5 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 74.125.78.146 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=GBJLuZJK26n1PNc4IymrUVtH8ZcCxMXaxGrMhsUs310=; b=qwzpEUadGFBCmv+Mnbw5iRy+HBBaUm12hQR0zjN24BdbLBg1g9+4VSwXsPS98nk48L vyFUEhP/tV2Yt4/sPnz5NORZBy5c06hXdrdo+QGnJedtTsUVFHpmEsd+TG4GV5bbrFUG JY+LOJT1fSz/3w63rJHrj7AtOq2L/pG+JwZTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=JnYpAnPcVzMDY1S3ZAdTaocOIOxem6a34aAYyVEgK1DNR4cfqRZru8A8of3MLiaZ5h NtLUfg3LynuU5GcjlbByeYg39FY6GrfqcUnTByJOGD3vAMYD61dTSO06/cMdHNemf5IA hMjeUMOrPbqcHG+eV3FmNJjj70/a7AaqhjPrs= MIME-Version: 1.0 In-Reply-To: <100222184752.ZM26580@torch.brasslantern.com> References: <2d460de71002220942y27ad63acxa3df7a9838ace0b8@mail.gmail.com> <100222184752.ZM26580@torch.brasslantern.com> Date: Tue, 23 Feb 2010 08:57:43 +0100 Message-ID: <237967ef1002222357x44b0c891m60d483a06d788df4@mail.gmail.com> Subject: Re: Proposed feature: Selectively avoid adding to history (with code) From: Mikael Magnusson To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 23 February 2010 03:47, Bart Schaefer wrote: > On Feb 22, =C2=A06:42pm, Richard Hartmann wrote: > } > } =C2=A0 zshaddhistory(){if [[ -n $FOO ]]; then return 1; fi} > } > } This allows me to modify my prompt, giving a visual clue that I am in > } try-out mode and will not put random testing stuff into my history. > } > } 1) If anyone else thinks this is useful and if it should be a _function > > It'd be more useful if I could retroactively delete the last several > commands from my history, because I never remember to turn this sort > of thing on before I start testing. :-) > > I'm not sure what you mean by "should be a _function"? > > } 2) If "$HIST_NO_STORE" is a good variable name > > Hrm. =C2=A0The option of that name means not to store commands that are f= or > history access (and hence was a poor model for all the other "HIST_" > options that came after it, e.g., HIST_NO_FUNCTIONS should really be > FUNC_NO_STORE if the pattern had been properly applied). > > HIST_DISABLE or would probably be a better name. =C2=A0Won't one of the s= ide- > effects be that you can't find those commands in the interactive history > either? =C2=A0I'd like stuff to remain in the interactive history but som= ehow > be tagged so they're never written to $HISTFILE, which brings me to ... > > } 3) If this would be better handled in an option > > A tagging effect probably does need to be controlled by an option, as > the alternative is a builtin you can only call from zshaddhistory() or > some such; but I think for what you've got here, your approach is fine. I have a widget that toggles $HISTFILE between empty and ~/.history, and it used to work fine, but lately it's been writing some entries to ~/.history after i turn it back on that were entered while it was empty, and i'm sure it used not to. It could be some option i've fiddled with though, i just haven't felt like experimenting with it yet. (of course this approach needs at least setopt incappendhistory). --=20 Mikael Magnusson