From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: REDO ? Date: Mon, 23 Apr 2007 13:16:42 -0700 (PDT) Message-ID: <34837.128.165.123.18.1177359402.squirrel@webmail.lanl.gov> References: <17190643.437781177343203022.JavaMail.www@wwinf4203> <2cd46e7f0704231301w724b2b6aw8ae103df4ddcf370@mail.gmail.com> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1177359436 10880 80.91.229.12 (23 Apr 2007 20:17:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 23 Apr 2007 20:17:16 +0000 (UTC) Cc: alinsoar@voila.fr, David Reitter , Stefan Monnier , rms@gnu.org, "Emacs Dev \[emacs-devel\]" To: "Ken Manheimer" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 23 22:17:09 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hg4yC-0008KY-No for ged-emacs-devel@m.gmane.org; Mon, 23 Apr 2007 22:17:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hg53d-0007z6-CF for ged-emacs-devel@m.gmane.org; Mon, 23 Apr 2007 16:22:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hg53K-0007ui-Mk for emacs-devel@gnu.org; Mon, 23 Apr 2007 16:22:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hg53J-0007u5-31 for emacs-devel@gnu.org; Mon, 23 Apr 2007 16:22:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hg53I-0007u1-OZ for emacs-devel@gnu.org; Mon, 23 Apr 2007 16:22:24 -0400 Original-Received: from mailwasher.lanl.gov ([192.65.95.54] helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hg4xo-0004tq-5b; Mon, 23 Apr 2007 16:16:44 -0400 Original-Received: from mailrelay3.lanl.gov (mailrelay3.lanl.gov [128.165.4.104]) by mailwasher-b.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l3NKGh3f029033; Mon, 23 Apr 2007 14:16:43 -0600 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay3.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l3NKGgh9006599; Mon, 23 Apr 2007 14:16:42 -0600 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id l3NKGgYb027110; Mon, 23 Apr 2007 14:16:42 -0600 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id l3NKGgK6027106; Mon, 23 Apr 2007 13:16:42 -0700 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.18 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Mon, 23 Apr 2007 13:16:42 -0700 (PDT) In-Reply-To: <2cd46e7f0704231301w724b2b6aw8ae103df4ddcf370@mail.gmail.com> User-Agent: SquirrelMail/1.4.8-4.el3.2lanl X-Priority: 3 (Normal) Importance: Normal X-PMX-Version: 4.7.1.128075 X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:69875 Archived-At: > i've used kyle jones' redo.el for a few years, and wouldn't go back to > the painful layering of undo-on-undo in order to redo. undoing feels > like a delicate, hazardous operation without redo, because of the > obstacle of geometrically mounting undo length in the case of > overshoot. i used to get lost in that labrynth much too commonly, and > expect that people unfamiliar with how well it is mitigated by redo > don't realize what they're missing - but may recognize the experience > of tension while undoing, needing to not overshoot... My take on this is somewhat simpler. I use the following function (which, though it works fine for me, could easily screw things up badly, so use at your own risk): ;; In order to propertly handle "already performing undos", this must be ;; bound to a key (not run via M-x). (defun undo-permanently () "Undo the most recent change and forget about it. Selective undo is not supported, so no prefix argument is accepted, and Transient Mark mode is ignored. If already performing undos, undo one more change and then forget it and all changes since." (interactive "*") (let (transient-mark-mode) (when (and (eq last-command 'undo) (not (eq pending-undo-list t))) ;; In Emacs 22, just test `undo-in-region' instead of all this: (let ((pbul buffer-undo-list)) (while (not (eq pbul pending-undo-list)) (if pbul (setq pbul (cdr pbul)) (error "Can't `undo-permanently' during a selective undo"))))) (undo) (message "Permanently undone!") (setq buffer-undo-list (unless (eq pending-undo-list t) pending-undo-list)))) I bind this to "C-+" (only available on a window system), which on US keyboards is one key over from "C-_". Then I use it instead of "undo" for all the trivial mistakes I make, and when I really want to back out of one thing and do another, and to undo (ha) the growth of the undo-list if it acquires too many "redundant" entries on the end. It doesn't precisely address your problem, but I find that it simplifies things and so makes undo less painful. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.