From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Raffaele Ricciardi Newsgroups: gmane.emacs.help Subject: How does `undo` know that `keyboard-quit`has been called? Date: Fri, 07 Nov 2014 22:36:51 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1415396425 5399 80.91.229.3 (7 Nov 2014 21:40:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2014 21:40:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 07 22:40:18 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XmrGU-0000Dl-4Z for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Nov 2014 22:40:18 +0100 Original-Received: from localhost ([::1]:33996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmrGT-00016w-EZ for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Nov 2014 16:40:17 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 7 Original-X-Trace: individual.net UVQam9jVTzFvzKxu5DylEAS53QTpO8fl9dfZE9qfFJrrLIlM0d Cancel-Lock: sha1:YQrceJxOLrY8GdZMy3sUFzA/QxM= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 Original-Xref: usenet.stanford.edu gnu.emacs.help:208561 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100839 Archived-At: 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`.) Thank you.