From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6045 invoked from network); 13 Oct 2007 17:11:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Oct 2007 17:11:53 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 47516 invoked from network); 13 Oct 2007 17:11:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Oct 2007 17:11:47 -0000 Received: (qmail 7416 invoked by alias); 13 Oct 2007 17:11:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23948 Received: (qmail 7400 invoked from network); 13 Oct 2007 17:11:44 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Oct 2007 17:11:44 -0000 Received: (qmail 47211 invoked from network); 13 Oct 2007 17:11:44 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 13 Oct 2007 17:11:37 -0000 Received: from torch.brasslantern.com ([71.116.76.59]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JPV00COL12XBEE3@vms044.mailsrvcs.net> for zsh-workers@sunsite.dk; Sat, 13 Oct 2007 12:11:22 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id l9DHBKW7014877 for ; Sat, 13 Oct 2007 10:11:21 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id l9DHBK7P014876 for zsh-workers@sunsite.dk; Sat, 13 Oct 2007 10:11:20 -0700 Date: Sat, 13 Oct 2007 10:11:18 -0700 From: Bart Schaefer Subject: Re: precmd, preexec, and supplied prompt themes In-reply-to: <20071013133057.GA1500@scowler.net> To: zsh-workers@sunsite.dk Message-id: <071013101120.ZM14875@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20071012215906.GA8935@mastermind> <20071012152257.91edf6d3.wgscott@chemistry.ucsc.edu> <20071013133057.GA1500@scowler.net> Comments: In reply to Clint Adams "Re: precmd, preexec, and supplied prompt themes" (Oct 13, 9:30am) On Oct 13, 9:30am, Clint Adams wrote: } } > typeset -a precmd_functions } > precmd_functions += my_prompt_precmd } } Since there is no unregistration hook, how would you avoid the problem } of precmd_functions containing (my_prompt_precmd her_prompt_precmd } his_prompt_precmd my_prompt_precmd) when switching back and forth? Well, there sort of is an unregistration hook: prompt_off_setup (meant to be invoked as "prompt off"). However, all it does is erase the precmd and preexec functions entirely, which is why I added an "off" switch to my theme ("prompt bart off"). *IF* we updated the themes to be clever about precmd_functions et al., then the "prompt" function should be updated to call prompt_off_setup before installing a new theme. However, that leaves the conundrum of whether/how to unregister PS1. "prompt bart", for example, piggybacks itself on top of whatever is already in PS1, and "prompt bart off" extricates itself to leave PS1 mostly as it was before. Right now "prompt off" stomps PS1 and PS2 back to the "zsh -f" default. So some discussion of how this ought to be redesigned would be useful before someone jumps in to do it. It's always seemed a bit clunky to me to do build up function names by sticking the theme name in the middle, but that's at nit-pick. Maybe all we need is another one of those functions, prompt_ZZZ_off (or pick another word). --