From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25991 invoked from network); 21 Sep 2008 10:01:00 -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 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 21 Sep 2008 10:01:00 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 1614 invoked from network); 21 Sep 2008 10:00:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Sep 2008 10:00:35 -0000 Received: (qmail 2717 invoked by alias); 21 Sep 2008 10:00:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25699 Received: (qmail 2702 invoked from network); 21 Sep 2008 10:00:28 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 21 Sep 2008 10:00:28 -0000 Received: from mx.spodhuis.org (redoubt.spodhuis.org [193.202.115.177]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 40D5E802720D for ; Sun, 21 Sep 2008 12:00:16 +0200 (CEST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=d200807; d=spodhuis.org; h=Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=kpGDjuOZdoOg93C54x2ho8kr5z5gHGghap6pR43YqfnBQ7te5OPTkGaMFUYxZk8OcLB6sUjskzjjoYP9eUQ5wv6jLbN/Dm+WNOXPEebYJ+z1yH2wNaXFEbTu8I4HE99Af1jxqVF0NiDGxZVKAvrUwuFZP7/tBM5AMCGvLaRG5KY=; Received: by smtp.spodhuis.org with local id 1KhLjV-00096t-IF; Sun, 21 Sep 2008 10:00:01 +0000 Date: Sun, 21 Sep 2008 03:00:01 -0700 From: Phil Pennock To: zsh-workers Subject: Re: Submitting vcs_info function Message-ID: <20080921100001.GA34894@redoubt.spodhuis.org> Mail-Followup-To: zsh-workers References: <20080917201859.GU2182@fsst.voodoo.lan> <20080917203242.GV2182@fsst.voodoo.lan> <20080921091111.GA26463@scru.org> <20080921093958.GA34405@redoubt.spodhuis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080921093958.GA34405@redoubt.spodhuis.org> X-Virus-Scanned: ClamAV 0.92.1/8296/Sun Sep 21 05:04:54 2008 on bifrost X-Virus-Status: Clean On 2008-09-21 at 02:39 -0700, Phil Pennock wrote: > Reports screen WINDOW, SHLVL, previous command exit status (including > signal name if sig-exit), count of backgrounded jobs, repository > information plus the usual bits. Has some automatic screen titling > stuff in the prompt too. Anyone have any recommendations for using zstyle with prompts? I've gone for: :prompt::<$TERM>: in the absence of any better ideas. This removes a TODO from the file, to move the employer logic out into a style. I sometimes make an effort to sync my configs a bit between the setups and it's useful to have the employer in my prompt; or at least, at 3.30am after the pager goes off and before coffee, I tend to think so. Besides, I use a really-cheesy multi-coloured tag reminiscent of my employer's logo, which makes people groan. :) ----------------------------8< cut here >8------------------------------ --- posted-prompt Sun Sep 21 02:55:21 2008 +++ prompt_pdp-vcs_setup Sun Sep 21 02:52:38 2008 @@ -1,7 +1,7 @@ # Phil's prompt setup for zsh # # $HeadURL: https://svn.spodhuis.org/ksvn/spodhuis-tools/zsh/site-functions/prompt_pdp-vcs_setup $ -# $Id: prompt_pdp-vcs_setup 239 2008-09-20 21:37:30Z xxx@SPODHUIS.ORG $ +# $Id: prompt_pdp-vcs_setup 240 2008-09-21 09:52:38Z xxx@SPODHUIS.ORG $ # # Installs somewhere in fpath; typically one of: # /usr/globnix/share/zsh/site-functions/prompt_pdp-vcs_setup @@ -90,7 +90,7 @@ function prompt_pdp-vcs_setup { local -h name root host mach line time level error jobc pathdisp vcs local -h p1 prefix='' trunclen=40 - local -h employer + local -h employer employer_domain local -h docolour=: [[ $1 == update ]] && docolour=false @@ -131,8 +131,13 @@ zstyle ':vcs_info:*' formats %b %s zstyle ':vcs_info:*' actionformats "%b|%a" %s -# Employer-dependent $HOST check elided from post + local style_ctx=":prompt:pdp-vcs:$TERM:" + $docolour && style_ctx+=colour || style_ctx+=mono employer='' + zstyle -s "$style_ctx" employer-domain employer_domain + if [[ -n $employer_domain && $HOST == *.$employer_domain ]]; then + zstyle -s "$style_ctx" employer-prompt employer + fi root="$(prompt_pdp-vcs_hl root %n)" name="$(prompt_pdp-vcs_hl name "%(#.${root}.%n)")" ----------------------------8< cut here >8------------------------------