[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scary undo
From: |
David Kastrup |
Subject: |
Re: Scary undo |
Date: |
Tue, 06 May 2008 12:15:47 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
"Lennart Borgman (gmail)" <address@hidden> writes:
> I would like to undo a change made by a function that I call with
> funcall. I do not know exactly what the function does, but hopefully
> it will only indent the current line. However the new indentation
> might be wrong.
>
> The scenario is something like this
>
> (funcall the-indentation-function)
> (when (= 0 (current-indentation))
> ;; undo what `the-indentation-function' did,
> ;; but how?
> )
>
> I am a bit scared of writing this undo part so if someone could help
> me I would be glad. I do not think I can use `undo-boundary' here.
I'd be tempted to do something like
(condition-case nil
(atomic-change-group
(funcall the-indentation-function)
(when (=0 (current-indentation))
(signal 'barfout)))
(barfout))
--
David Kastrup
- Scary undo, Lennart Borgman (gmail), 2008/05/06
- Re: Scary undo, Juanma Barranquero, 2008/05/06
- Re: Scary undo,
David Kastrup <=