From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10982 invoked from network); 15 Dec 2003 10:59:05 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Dec 2003 10:59:05 -0000 Received: (qmail 26615 invoked by alias); 15 Dec 2003 10:58:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19284 Received: (qmail 26544 invoked from network); 15 Dec 2003 10:58:56 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 15 Dec 2003 10:58:56 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 15 Dec 2003 10:58:56 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Mon, 15 Dec 2003 10:57:51 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 15 Dec 2003 10:59:31 +0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: widget called when zle starts. In-reply-to: "Bart Schaefer"'s message of "Sat, 13 Dec 2003 19:34:04 GMT." <1031213193404.ZM5612@candle.brasslantern.com> Date: Mon, 15 Dec 2003 10:57:55 +0000 Message-ID: <21461.1071485875@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 15 Dec 2003 10:59:31.0784 (UTC) FILETIME=[848B4C80:01C3C2FA] Bart Schaefer wrote: > I'm a bit concerned that this is going to be called at unexpected times, > such as every pass around a "select" loop, or right before printing the > to PS2 prompt, etc. Normally I'd think one only wants it called before > the first PS1 prompt, at approximately the same time as precmd. Well, for it to do the example given, it needs to be called every time zle is started for whatever reason. I think that's the only consistent thing to do by default. It should be possible to get more control, though. You can already test for context, e.g. $PREBUFFER. Another zle variable giving more about the context is a possibility. > A comment on the example: > > } +example(zle-line-init() { zle -K vicmd; } > > It might be worth mentioning that this is the same as > > zle-line-init() { zle vi-cmd-mode } > > (The trailing ';' isn't necessary, is it?) Not in zsh, I just tend to use it for compatibility. -- 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 **********************************************************************