From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28008 invoked from network); 20 Jul 2001 18:09:41 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 20 Jul 2001 18:09:41 -0000 Received: (qmail 6969 invoked by alias); 20 Jul 2001 18:09:35 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15436 Received: (qmail 6958 invoked from network); 20 Jul 2001 18:09:34 -0000 From: "Bart Schaefer" Message-Id: <1010720180829.ZM7428@candle.brasslantern.com> Date: Fri, 20 Jul 2001 18:08:29 +0000 In-Reply-To: Comments: In reply to Peter Stephenson "PATCH: bash-transpose-words" (Jul 20, 11:49am) References: X-Mailer: Z-Mail (5.0.0 30July97) To: Peter Stephenson , zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: bash-transpose-words MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 20, 11:49am, Peter Stephenson wrote: } } Now what I'd really like is for the cursor to stay at the point [...] } with marks --- which I still don't trust if text has been moving around, } but I haven't analysed what I don't trust well enough to suggest what needs } fixing. The mark in zsh is just an offset in $BUFFER. In emacs it (effectively) is a zero-width pseudo-character located between two real characters. That means you can move stuff around the mark in emacs and it shifts left or right along with the unchanging characters adjacent to it. In zsh, this effect is sometimes mimicked by (in|de)crementing the mark position as characters are (inserted|deleted), but it is not done consistently. So given this text: echo abcdefg dcba ^ cursor and mark both here In emacs, after transpose-words: echo dcba abcdefg ^ cursor and mark both here (moved with the space) But in zsh: echo dcba abcdefg ^ mark here (same buffer offset), cursor at end Sven and I had a discussion a while back about the difficulty of keeping the mark consistent when one can do wholesale assignments to $BUFFER without passing through the usual zle functions. It was inconclusive. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net