From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17814 invoked from network); 7 Nov 1998 18:34:54 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 7 Nov 1998 18:34:54 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id NAA21395; Sat, 7 Nov 1998 13:33:44 -0500 (EST) Resent-Date: Sat, 7 Nov 1998 13:33:44 -0500 (EST) From: "Bart Schaefer" Message-Id: <981107103211.ZM7932@candle.brasslantern.com> Date: Sat, 7 Nov 1998 10:32:11 -0800 In-Reply-To: <199811060750.IAA04335@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: another bug in suffix removal 3.1.5" (Nov 6, 8:50am) References: <199811060750.IAA04335@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-workers@math.gatech.edu Subject: Re: another bug in suffix removal 3.1.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"m0ZwO.0.BE5.8A9Hs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4588 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Nov 6, 8:50am, Sven Wischnowsky wrote: } Subject: Re: another bug in suffix removal 3.1.5 } } Peter Stephenson wrote: } > } > Sven Wischnowsky wrote: } > > greg@alphatech.com wrote: } > > } > > > % bar # IE, get "bar" in the kill ring } > > > % ls f } > > > -> foo/ } > > > -> foobar # the slash got removed } > > } > > another missing fixsuffix() problem. } > } > Isn't it just a case of adding ZLE_KEEPSUFFIX to the flags for yank? } } Personally I would prefer zsh to leave the suffix on the line and } automatically removable in whenever a zle widget doesn't change the } line and cursor position. But maybe I'm the only one who would prefer } that. Philosophical aside: The 3.0.5 completion mechanism decides whether to autoremove almost entirely based on what zle-command is next invoked. 3.1.5 is trying to get away from that in order to make the widget set extensible, which is why we have so many of these fixsuffix() problems. ZLE_KEEPSUFFIX is the standard escape back into the 3.0.5 style for widgets that haven't been taught the new requirements yet, but it's a lot more reliable and maintainable than sprinkling fixsuffix() around has been. Back to the topic at hand: This brings up a general question of what should happen on a widget failure (either a feep, or when it simply can't do anything). For example, zsh% mkdir /tmp/bar zsh% ls /tmp/b zsh% ls /tmp/bar/ zsh% ls /tmp/bar Note that when I *tried* to move the cursor, the slash got removed, even though the cursor couldn't actually move. Similarly (with ^X^A not bound to anything): zsh% ls /tmp/b zsh% ls /tmp/bar/ (feep) zsh% ls /tmp/bar I think this argues (again) for some kind of return code from widget functions (propagated via the standard "return" builtin for user- defined widgets) so that they can notify the line editor when they do nothing. This could then be handled by zleread() in the same way that not finding any binding at all is handled (except for the feep), which we could then fix to match Sven's preference (which is a sensible one). Until such time as all that has happened, I think PWS's fix is fine. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com