From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: Emacs attach an action to any key pressed Date: Wed, 05 Jun 2013 07:24:29 -0600 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1370441615 26793 80.91.229.3 (5 Jun 2013 14:13:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Jun 2013 14:13:35 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 05 16:13:34 2013 Return-path: Envelope-to: ged-emacs-devel@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 1UkET0-0008VW-FL for ged-emacs-devel@m.gmane.org; Wed, 05 Jun 2013 16:13:34 +0200 Original-Received: from localhost ([::1]:50499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkET0-0008ED-0Y for ged-emacs-devel@m.gmane.org; Wed, 05 Jun 2013 10:13:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkDgh-0000Zi-4R for emacs-devel@gnu.org; Wed, 05 Jun 2013 09:23:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkDgf-0002os-AE for emacs-devel@gnu.org; Wed, 05 Jun 2013 09:23:39 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkDgf-0002o1-4N for emacs-devel@gnu.org; Wed, 05 Jun 2013 09:23:37 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UkDgd-00055M-GI for emacs-devel@gnu.org; Wed, 05 Jun 2013 15:23:35 +0200 Original-Received: from 71-212-228-63.hlrn.qwest.net ([71.212.228.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jun 2013 15:23:35 +0200 Original-Received: from kevin.d.rodgers by 71-212-228-63.hlrn.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jun 2013 15:23:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 71-212-228-63.hlrn.qwest.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160106 Archived-At: On 6/5/13 1:56 AM, Ivanov Dmitry wrote: > I tried this: > > (defun dummy () > (interactive) > (message "aaa") > (remove-hook 'post-command-hook 'dummy)) > > (add-hook 'post-command-hook 'dummy) > > It prints "aaa" exactly after I press C-x e on add-hook command. But I want it > to print only when I press any key afterwards. What should I do? (when (read-event "Press any key to continue: ") (message "aaa")) -- Kevin Rodgers Denver, Colorado, USA