From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25827 invoked from network); 4 Jul 2004 21:38:53 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 4 Jul 2004 21:38:53 -0000 Received: (qmail 13360 invoked from network); 4 Jul 2004 22:52:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Jul 2004 22:52:45 -0000 Received: (qmail 17772 invoked by alias); 4 Jul 2004 21:38:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20132 Received: (qmail 17761 invoked from network); 4 Jul 2004 21:38:29 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 4 Jul 2004 21:38:29 -0000 Received: (qmail 13090 invoked from network); 4 Jul 2004 22:52:39 -0000 Received: from unknown (HELO moonbase.zanshin.com) (@167.160.213.139) by a.mx.sunsite.dk with SMTP; 4 Jul 2004 22:52:26 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i64LcD3c015206 for ; Sun, 4 Jul 2004 14:38:13 -0700 Date: Sun, 4 Jul 2004 14:38:13 -0700 (PDT) From: Bart Schaefer Reply-To: Zsh hackers list To: Zsh hackers list Subject: Re: PATCH: re-expand the prompt automatically In-Reply-To: <20040704171756.0537685BC@pwstephenson.fsnet.co.uk> Message-ID: References: <20040704171756.0537685BC@pwstephenson.fsnet.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Sun, 4 Jul 2004, Peter Stephenson wrote: > Bart Schaefer wrote: > > (It would seem that, with this patch, "zle -I" can be used instead of > > reset-prompt. > > That's not quite true. zle -I invalidates the display, redrawing the > prompt below. [...] zle reset-prompt reexpands the prompt on the > current line. Aha. I hadn't caught that distinction. > > Further, it seems odd to make reset-prompt a built-in > > widget rather than a zle option.) > > I don't understand that. How would the option know when to reexpand the > prompt? In part this suggestion came from my misinterpretation of reset-prompt (by the way, the ChangeLog calls it "prompt-reset".) However: > Are you suggesting it be tied to zle -R or zle redisplay or both? Neither ... Put to it, I don't think "redisplay" should have been a built-in widget either, except that for historic reasons it had to be. I'm suggesting that built-in widgets should always act on the editor buffer (on either the contents or the position of the mark or the cursor) whereas zle options -- or special commands like compadd -- should act on the editing engine itself (widgets, keymaps, prompts and displays). My criteria would best be described by the question, "Would it ever make sense to use any of the zle -A, -C, -D, or -N options to supercede or remove this action?" If the answer is yes, it should be a widget; if no, then either a zle option or a separate command. I recognize that the line is pretty fuzzy, and now I see that reset-prompt is a lot deeper in the fuzz than I originally thought.