[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How does `undo` know that `keyboard-quit`has been called?
From: |
Stefan Monnier |
Subject: |
Re: How does `undo` know that `keyboard-quit`has been called? |
Date: |
Fri, 07 Nov 2014 17:02:00 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> I would like to write a command that behaves like `undo`, that is: a command
> that reverses its behaviour when the user calls `keyboard-quit`. I have read
> the Lisp code for both `undo` and `keyboard-quit` and I can't understand how
> `undo` achieves such behaviour. (I know that I could always advise
> `keyboard-quit`.)
undo reverses its behavior after any other command than undo.
I.e. keyboard-quit is not special in this respect. The only part that's
special about keyboard-quit is that if you use it like that, it
typically doesn't do anything else (well, it beeps).
Stefan