From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: make undo operate as in (no flames please) vim Date: Sat, 24 Jan 2009 17:04:32 -0800 Message-ID: <000f01c97e88$e231db20$0200a8c0@us.oracle.com> References: <87eiyusrn4.fsf@newsguy.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232845508 5321 80.91.229.12 (25 Jan 2009 01:05:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Jan 2009 01:05:08 +0000 (UTC) To: "'Harry Putnam'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 25 02:06:20 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LQtRs-0007ZP-9w for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2009 02:06:04 +0100 Original-Received: from localhost ([127.0.0.1]:55821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQtQa-0005lP-QV for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Jan 2009 20:04:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQtQI-0005lF-PW for help-gnu-emacs@gnu.org; Sat, 24 Jan 2009 20:04:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQtQI-0005l3-8W for help-gnu-emacs@gnu.org; Sat, 24 Jan 2009 20:04:26 -0500 Original-Received: from [199.232.76.173] (port=33830 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQtQI-0005l0-53 for help-gnu-emacs@gnu.org; Sat, 24 Jan 2009 20:04:26 -0500 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:25480 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQtQH-00081w-Lb for help-gnu-emacs@gnu.org; Sat, 24 Jan 2009 20:04:25 -0500 Original-Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0P16In2004811 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 25 Jan 2009 01:06:19 GMT Original-Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0P14J0P023685; Sun, 25 Jan 2009 01:04:21 GMT Original-Received: from dradamslap1 (/24.5.128.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 24 Jan 2009 17:04:19 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87eiyusrn4.fsf@newsguy.com> Thread-Index: Acl+hhpgMPwi+68hRIqmE2l3TkSVbwAAJIDw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt704.oracle.com [141.146.40.82] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.497BBA94.01A9:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61619 Archived-At: > One thing I've actually come to dread is using undo. I've never taken > the time to get this setup in some way that seems more useful to me. > I always just go for the `C-x u' repeatedly or else preface with some > number (C-u 20 C-x u) to get close if lots of undos are needed. > > I often hit `C-x-u' (forgetting to release the C-x part) which brings > me to `upcase-region', which I keep disabled; that means I'm whisked > to a lengthy message about using `upcase-region' and generally > completely disrupting what I was doing. > > This is of my own making and not a fault of emacs, but still I'd like > to have the undo behavior I find in vim. It seems way closer to what > I usually want. Where I press some keycombo and a whole sentence or > whatever is undone. Instead of `C-x u' repeatedly to undo the same > line or even paragraph of type. I can't help with the main question you raise (Vim-like undo), but I do wonder why you use `C-x u' for undo. Both `C-_' and `C-/' are a lot easier to use, assuming they are available to you. In particular, you can just hold them down to repeat, something you cannot do with `C-x u'. If those keys are not available for some reason, and until you find a Vim-like solution you are really happy with, why not bind undo to a simple key sequence that can be repeated just by pressing and holding it? The Emacs manual, node Undo, says that `C-x u' is really available as a binding only because it is supposedly easier for users to remember. Personally, I think we should get rid of that default binding. I cannot imagine anyone using an undo binding that you can't just hold down to repeat. To me, that binding is a vestige that should be excised. The last thing we should do is encourage a new user, using the rationale of being easier to remember, to get in the bad habit of using a key sequence that is not appropriate for undo. I also don't recommend using a prefix arg with undo, except in particular contexts. That is, if you're just guessing at a number, trying to aim at the right number of undo operations directly, then I think that's probably a mistake. In particular, if you want to return to an unmodified buffer, you risk going past the origin without knowing it. (Yes, you can always revert the buffer as an alternative.) Anyway, people use Emacs differently; these are just my thoughts, based on my own habits. YMMV.