From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21565 invoked from network); 13 Oct 2006 09:16:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.6 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Oct 2006 09:16:23 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 46874 invoked from network); 13 Oct 2006 09:16:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Oct 2006 09:16:13 -0000 Received: (qmail 19558 invoked by alias); 13 Oct 2006 09:16:06 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10857 Received: (qmail 19547 invoked from network); 13 Oct 2006 09:16:05 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Oct 2006 09:16:05 -0000 Received: (qmail 45604 invoked from network); 13 Oct 2006 09:16:05 -0000 Received: from parhelion.firedrake.org (193.201.200.77) by a.mx.sunsite.dk with SMTP; 13 Oct 2006 09:16:05 -0000 Received: from phil by parhelion.firedrake.org with local (Exim 4.50 #1 (Debian)) id 1GYJ99-0007L9-Pq for ; Fri, 13 Oct 2006 10:16:03 +0100 Date: Fri, 13 Oct 2006 11:16:03 +0200 From: Phil Pennock To: zsh-users@sunsite.dk Subject: Re: Makeing history harmless Message-ID: <20061013091603.GA27223@parhelion.globnix.org> Mail-Followup-To: zsh-users@sunsite.dk References: <20061012.044715.74744338.Meino.Cramer@gmx.de> <20061012050911.GA4764@parhelion.globnix.org> <20061012131521.GA8265@namib.cs.utk.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061012131521.GA8265@namib.cs.utk.edu> Sender: Phil Pennock On 2006-10-12 at 09:15 -0400, Chris Johnson wrote: > Phil Pennock sent me the following 0.9K: > > On 2006-10-12 at 04:47 +0200, Meino Christian Cramer wrote: > > > Is it possible to write a "something" to filter out certain commands > > > or to modify certain commands before they were copied from the > > > commandline into the history ? > I do this with: I do neither, I was just helping the OP, Meino. :^) > setopt hist_ignore_space > alias rm=' rm' > > Is there an advantage to using the widget? Not really, unless you want to avoid global aliases whilst writing something which can special-case things like "svn rm"; you could have nested case statements examining different items in ${(z)BUFFER} and possibly triggering other effects too. Heck, build a whole new dispatch system for command hooks, a la compsys. ;^) In summary, zsh is mighty and there's more than one way to do it. -Phil