From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: unreading a command key sequence Date: Wed, 07 May 2008 21:43:25 -0400 Message-ID: References: <48210959.9050500@gmail.com> <482161D0.1030203@gmail.com> <4821F678.4070100@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210211405 12968 80.91.229.12 (8 May 2008 01:50:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 May 2008 01:50:05 +0000 (UTC) Cc: Emacs Devel To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 08 03:50:37 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JtvHJ-0003hk-1L for ged-emacs-devel@m.gmane.org; Thu, 08 May 2008 03:50:37 +0200 Original-Received: from localhost ([127.0.0.1]:57650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtvGa-0007en-Sq for ged-emacs-devel@m.gmane.org; Wed, 07 May 2008 21:49:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtvGX-0007eS-3J for emacs-devel@gnu.org; Wed, 07 May 2008 21:49:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtvGU-0007eG-Nk for emacs-devel@gnu.org; Wed, 07 May 2008 21:49:47 -0400 Original-Received: from [199.232.76.173] (port=39960 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtvGU-0007eD-HZ for emacs-devel@gnu.org; Wed, 07 May 2008 21:49:46 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:40140 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JtvGU-0007l7-8q for emacs-devel@gnu.org; Wed, 07 May 2008 21:49:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsIEADP5IUhMCrRp/2dsb2JhbACBU6ty X-IronPort-AV: E=Sophos;i="4.27,451,1204520400"; d="scan'208";a="20059150" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 07 May 2008 21:49:45 -0400 Original-Received: from ceviche.home ([76.10.180.105]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id OGF73445 for ; Wed, 07 May 2008 21:49:45 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 6EE54B4123; Wed, 7 May 2008 21:43:25 -0400 (EDT) In-Reply-To: <4821F678.4070100@gmail.com> (Lennart Borgman's message of "Wed, 07 May 2008 20:35:36 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96725 Archived-At: > I do this in pre-command-hook and I just did forget that this-command still > will be carried out (and that was what I wanted to prevent). I think this is > what I should do instead: > (setq this-command 'tunnel-last-command) > (setq unread-command-events > (append unread-command-events > (listify-key-sequence > (this-command-keys-vector)) > nil)) > (defun tunnel-last-command () > "Set `this-command' to `last-command'." > (interactive) > (setq this-command last-command)) > This works for in the tests I have made (including some with Viper undo > involved). If this is the way to do such things in pre-command-hook then > this might be worth documenting. You seem to be thinking out loud. I don't know what you mean by "such things". Stefan