help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tricky - undo function - planning info


From: Emanuel Berg
Subject: Re: tricky - undo function - planning info
Date: Mon, 08 Jun 2015 00:15:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

gnuist006@gmail.com writes:

> Normally M-x undo would undo each step.

Bind that to a key if it isn't already. Short and
close. I have that M-0 but I think the standard is C-/
among others. Train your fingers with the one you like
the most.

> A function may comprise one or more steps.
> When a function is applied, and then undone, it is
> not clear how many steps of undo are really needed.

I don't think you should rely on `undo' to be safe
from such things too much. Better undo basic editing
mistakes (as in when you change your mind) and such
things. Sometimes tho undo is a lifesaver but I'd
recommend not relying on it too much to fix mistakes.
Instead, focus on not doing mistakes (actually
gradually making fewer and fewer). Behave like a pro
that is what you become.

> This is really a very basic need and should have
> been addressed - and solved decades ago.

Centuries! :)

> I am looking for a good plan of what to do to
> achieve this functionality and basic facility.

I suppose you can poll `buffer-undo-list' and examine
how it grows. You can have a function echo that digit
(the number of steps), or have it appear in the mode
line. Will this actually be better than hitting the
undo keystroke repeatedly? With a doubt: maybe.

> Then again, maybe it is already implemented and
> undocumented, or there is a simple solution.

Indeed, you don't know that and there is no foolproof
way of knowing to my knowledge.

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]