From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.help Subject: Re: make undo operate as in (no flames please) vim Date: Sun, 25 Jan 2009 10:51:38 -0600 Organization: Still searching... Message-ID: <87vds3miqt.fsf@newsguy.com> References: <87eiyusrn4.fsf@newsguy.com> <000f01c97e88$e231db20$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1232902436 16926 80.91.229.12 (25 Jan 2009 16:53:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Jan 2009 16:53:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 25 17:53:39 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 1LR8Es-00086Q-0Z for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2009 17:53:38 +0100 Original-Received: from localhost ([127.0.0.1]:46101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR8Da-0008E9-4s for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2009 11:52:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LR8DD-0008CZ-51 for help-gnu-emacs@gnu.org; Sun, 25 Jan 2009 11:51:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LR8DC-0008Bm-Hc for help-gnu-emacs@gnu.org; Sun, 25 Jan 2009 11:51:54 -0500 Original-Received: from [199.232.76.173] (port=39101 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR8DC-0008BZ-9r for help-gnu-emacs@gnu.org; Sun, 25 Jan 2009 11:51:54 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:57201 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LR8DB-0006xC-Md for help-gnu-emacs@gnu.org; Sun, 25 Jan 2009 11:51:54 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LR8D6-0007i8-7T for help-gnu-emacs@gnu.org; Sun, 25 Jan 2009 16:51:48 +0000 Original-Received: from c-98-215-178-6.hsd1.in.comcast.net ([98.215.178.6]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Jan 2009 16:51:48 +0000 Original-Received: from reader by c-98-215-178-6.hsd1.in.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Jan 2009 16:51:48 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 63 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-215-178-6.hsd1.in.comcast.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:N2PtBdbxtlmP91wUffUSoutWcv8= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:61627 "Drew Adams" writes: [...] >> 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. Long habit I guess. > 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? C-_ seems pretty ungainly but yes C-/ is handy and I'd forgotten all about being able to hold it down. That alone may be enough to make me a happy camper. > 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 may be living testimony to your line of reasoning there. > 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.) You've hit on one of the reasons I had grown to dread using undo. I resorted to the prefix arg to eliminate possibly dozens of C-x u presses which inevitably would lead sooner or later to hitting `C-x-u', the dread upcase-region that totally disrupts the work flow. And, like you guessed... there'd come a point where I'd have to figure out if I'd passed the goal, and by then it wasn't unlikely that I'd be somewhat confused about what was or wasn't undone.... Then the whole thing with arrow keys to indicate which way to go with undo can get pretty confusing too. Now if only I can break the ingrained habit of using C-x u....