From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1214 invoked by alias); 6 Jul 2015 08:40:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35698 Received: (qmail 1441 invoked from network); 6 Jul 2015 08:40:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f5-f794b6d000001495-8f-559a3eef79fb Date: Mon, 06 Jul 2015 09:39:57 +0100 From: Peter Stephenson To: Zsh workers Subject: Re: Undo is also confused with narrow-to-region Message-id: <20150706093957.33d9cb25@pwslap01u.europe.root.pri> In-reply-to: References: <8242.1435937191@thecus.kiddle.eu> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsVy+t/xy7rv7WaFGizcamhxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mjb8ucVSsIKrYsqjNawNjMs5uhg5OCQETCS2/3PrYuQEMsUk LtxbzwZiCwksZZQ4tiOpi5ELyJ7BJLH3+AtGCGcro8TqtgesIFUsAqoS96c8A7PZBAwlpm6a zQhiiwDF55w4BRYXFrCQ+PfwIVicV8Be4tCDd2AbOAWCJWY/fscIsa1UYl/XEXYQm19AX+Lq 309MEBfZS8y8cgaqV1Dix+R7LCA2s4CWxOZtTawQtrzE5jVvmSHmqEvcuLubfQKj0CwkLbOQ tMxC0rKAkXkVo2hqaXJBcVJ6rpFecWJucWleul5yfu4mRkjIft3BuPSY1SFGAQ5GJR7eiJqZ oUKsiWXFlbmHGCU4mJVEeBdzzQoV4k1JrKxKLcqPLyrNSS0+xCjNwaIkzjtz1/sQIYH0xJLU 7NTUgtQimCwTB6dUA+OOp74vKnnm89W8Dfro0flpQUK2YdIa3oUXV82at+rPcodIt48r32am 7lawcL82+WXZ0x83HsTVJN45mqba6Hl7bXVhyvwZBofnV/i9lj4uFL3tdnjiOoXdRRWW/Cam ncVFuol9i5Tuv5rbw6prnulf8cF9o/ei1+zC29R+3vnczxbMvc9v0xUlluKMREMt5qLiRACF D1XmVQIAAA== On Fri, 3 Jul 2015 20:12:13 +0200 Mikael Magnusson wrote: > On Fri, Jul 3, 2015 at 5:26 PM, Oliver Kiddle wrote: > > Within narrow-to-region, undo will put back the full BUFFER that is then > > duplicated from PREDISPLAY/POSTDISPLAY. After narrow-to-region, the > > opposite problem occurs with the part that was not part of the BUFFER > > being lost. > > > > This isn't that easy to solve. recursive-edit could save and restore the > > undo structures but for some uses of recursive-edit, such as that shown > > for it in the manual, that might not be the right thing anyway. > > Would it be possible to implement some kind of 'zle push-undo-stack' > and 'zle pop-undo-stack'? If you push it you would get a whole new > instance of undo, and popping it then throws all those entries away > again. I can't really think of an instance outside recursive-edit > where it would be useful, though. You can already basically do this: see read-from-minibuffer. integer changeno=$UNDO_CHANGE_NO remembers the current undo (the undo numbers are unique up to integer wrap, which isn't supposed to happen unless you're editing infinite numbers of editions of Shakespeare using monkeys). zle undo $changeno then winds the undos back to that point. pws