From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14179 invoked from network); 2 Jul 2004 15:24:28 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 2 Jul 2004 15:24:28 -0000 Received: (qmail 11753 invoked from network); 2 Jul 2004 16:36:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Jul 2004 16:36:57 -0000 Received: (qmail 11656 invoked by alias); 2 Jul 2004 15:24:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20127 Received: (qmail 11647 invoked from network); 2 Jul 2004 15:24:05 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 2 Jul 2004 15:24:05 -0000 Received: (qmail 11236 invoked from network); 2 Jul 2004 16:36:45 -0000 Received: from lhuumrelay3.lnd.ops.eu.uu.net (62.189.58.19) by a.mx.sunsite.dk with SMTP; 2 Jul 2004 16:36:32 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i62FNPv02253 for ; Fri, 2 Jul 2004 15:23:25 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Fri, 2 Jul 2004 16:22:44 +0100 Received: from news01.csr.com ([192.168.143.38]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 2 Jul 2004 16:24:09 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.12.11/8.12.11) with ESMTP id i62FNNDp002534 for ; Fri, 2 Jul 2004 16:23:23 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.12.11/8.12.11/Submit) with ESMTP id i62FNNrh002531 for ; Fri, 2 Jul 2004 16:23:23 +0100 Message-Id: <200407021523.i62FNNrh002531@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: re-expand the prompt automatically In-reply-to: "Wayne Davison"'s message of "Thu, 01 Jul 2004 09:44:46 PDT." <20040701164446.GA22234@blorf.net> Date: Fri, 02 Jul 2004 16:23:23 +0100 From: Peter Stephenson X-OriginalArrivalTime: 02 Jul 2004 15:24:09.0778 (UTC) FILETIME=[9F2EE920:01C46048] X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=BAYES_50 autolearn=no version=2.63 X-Spam-Hits: 0.0 Here's the tweak I just proposed to Wayne's patch: the only difference is the `if (trashedzle)', plus the patch to the documentation. If the test succeeds we know the command line will be completely reprinted, so this should do nicely what we want. Index: Src/Zle/zle_main.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v retrieving revision 1.46 diff -u -r1.46 zle_main.c --- Src/Zle/zle_main.c 1 Jul 2004 14:55:58 -0000 1.46 +++ Src/Zle/zle_main.c 2 Jul 2004 15:22:34 -0000 @@ -1311,14 +1311,20 @@ } /**/ -int -resetprompt(UNUSED(char **args)) +void +reexpandprompt(void) { free(lpromptbuf); lpromptbuf = promptexpand(raw_lp, 1, NULL, NULL); free(rpromptbuf); rpromptbuf = promptexpand(raw_rp, 1, NULL, NULL); +} +/**/ +int +resetprompt(UNUSED(char **args)) +{ + reexpandprompt(); return redisplay(NULL); } Index: Src/Zle/zle_refresh.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v retrieving revision 1.12 diff -u -r1.12 zle_refresh.c --- Src/Zle/zle_refresh.c 2 Jun 2004 22:15:02 -0000 1.12 +++ Src/Zle/zle_refresh.c 2 Jul 2004 15:22:35 -0000 @@ -291,7 +291,9 @@ unsigned char *tmpline; /* line with added pre/post text */ int tmpcs, tmpll; /* ditto cursor position and line length */ int tmpalloced; /* flag to free tmpline when finished */ - + + if (trashedzle) + reexpandprompt(); /* If this is called from listmatches() (indirectly via trashzle()), and * * that was called from the end of zrefresh(), then we don't need to do * -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************