From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.emacs.help Subject: Re: Undo manipulation Date: Thu, 14 Aug 2003 20:29:10 GMT Organization: Newt Software Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87oeys56gb.fsf@olgas.newt.com> References: <87adac7du0.fsf@olgas.newt.com> <3F3BBF2D.3010009@yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1060893141 25153 80.91.224.253 (14 Aug 2003 20:32:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2003 20:32:21 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 14 22:32:19 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19nOlf-0002ZL-00 for ; Thu, 14 Aug 2003 22:32:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19nOjs-0006LR-78 for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Aug 2003 16:30:28 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!feed2.news.rcn.net!rcn!elnk-atl-nf1!newsfeed.earthlink.net!prodigy.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr13.news.prodigy.com.POSTED!ad3e664c!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux) Cancel-Lock: sha1:gxWfc8Rt1W1r7eqGiJX1+ETZPcI= Original-Lines: 42 Original-NNTP-Posting-Host: 206.127.228.194 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr13.news.prodigy.com 1060892950 ST000 206.127.228.194 (Thu, 14 Aug 2003 16:29:10 EDT) Original-NNTP-Posting-Date: Thu, 14 Aug 2003 16:29:10 EDT X-UserInfo1: Q[R_PJON_ZSMBRXXKROD]_\@VR]^@B@MCPWZKB]MPXHDUWYAKVUOPCW[ML\JXUCKVFDYZKBMSFX^OMSAFNTINTDDMVW[X\THOPXZRVOCJTUTPC\_JSBVX\KAOTBAJBVMZTYAKMNLDI_MFDSSOLXINH__FS^\WQGHGI^C@E[A_CF\AQLDQ\BTMPLDFNVUQ_VM Original-Xref: shelby.stanford.edu gnu.emacs.help:115897 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11815 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11815 Kevin Rodgers writes: > Bill Wohler wrote: > >> I don't want to add some manipulation to buffer-undo-list. For >> example, let's say I have: >> 1. blah >> 2. blah >> xyz >> 3. blah >> and I want an undo to hit #3, then #2 and then #1, leaving xyz alone. >> Are there normal ways to do this? Like inserting markers in >> buffer-undo-list to later remove desired elements. >> It just occurred to me that I could save buffer-undo-list into a >> temporory variable, do my thing, and then restore the variable. > > > Exactly: > > (let ((buffer-undo-list t)) > (insert "xyz\n")) Cool, thanks. However, I was not pleased with the results in my case since the ignored manipulations occurred near the top and near the bottom of the buffer. So subsequent undos were very confused. Here's a little more info. We have a radio button menu item that performs these actions I've described. Currently, the undo will undo the action stepwise, but the radio button will no longer represent reality. Ideally, an undo would undo the entire set of actions in one swoop, and set the radio button back to its previous setting. Is this possible? Otherwise, would it be better or worse for us to set buffer-undo-list to nil to prevent the radio button from getting out of sync? -- Bill Wohler http://www.newt.com/wohler/ GnuPG ID:610BD9AD Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian! If you're passed on the right, you're in the wrong lane.