all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Harry Putnam <reader@newsguy.com>
To: help-gnu-emacs@gnu.org
Subject: Re: make undo operate as in (no flames please) vim
Date: Sun, 25 Jan 2009 10:51:38 -0600	[thread overview]
Message-ID: <87vds3miqt.fsf@newsguy.com> (raw)
In-Reply-To: 000f01c97e88$e231db20$0200a8c0@us.oracle.com

"Drew Adams" <drew.adams@oracle.com> 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.... 





  reply	other threads:[~2009-01-25 16:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25  0:43 make undo operate as in (no flames please) vim Harry Putnam
2009-01-25  1:04 ` Drew Adams
2009-01-25 16:51   ` Harry Putnam [this message]
2009-01-25 17:02     ` Drew Adams
2009-01-25 18:16       ` Samuel Wales
2009-01-25 19:29         ` Drew Adams
2009-01-25 19:53           ` Samuel Wales
     [not found]       ` <mailman.5772.1232907408.26697.help-gnu-emacs@gnu.org>
2009-01-25 19:59         ` David Kastrup
2009-01-25 20:55           ` Samuel Wales
2009-01-28 15:14         ` Ken Goldman
2009-01-28 20:21           ` Samuel Wales
     [not found] <mailman.5688.1232844257.26697.help-gnu-emacs@gnu.org>
2009-01-25  7:41 ` Xah Lee
2009-01-25  8:28   ` Andreas Politz
2009-01-25 16:59     ` Harry Putnam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vds3miqt.fsf@newsguy.com \
    --to=reader@newsguy.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.