From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Very Specific Key Press Behaviour Date: 22 Jun 2009 21:16:51 GMT Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1245706844 13134 80.91.229.12 (22 Jun 2009 21:40:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2009 21:40:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 22 23:40:42 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MIrFp-0000a3-TY for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Jun 2009 23:40:42 +0200 Original-Received: from localhost ([127.0.0.1]:49143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIrFp-0002YV-CC for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Jun 2009 17:40:41 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 14 Original-X-Trace: individual.net /0iMZ4hbpw6WpYJIlyMkjwJMUV1Y1BCO/O8KHgXOJ2RMvOnHy7 Cancel-Lock: sha1:ZcipRbzYsVUkQiu5hjv66mmo9BM= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/0.9.9 (Linux) Original-Xref: news.stanford.edu gnu.emacs.help:170220 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65439 Archived-At: Nordlöw wrote: > How can I bind an action to a key when it is pressed the n:th time, > possibly with different behaviour the 3:rd time compared to the 2:nd > and 1:st time. this is essentially what yank-pop (bound to M-y) does. so check out its implementation in simple.el. basically, you need the variables last-command and this-command. -- Joost Kremers joostkremers@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)