From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Function for deleting a key binding in a sparse keymap Date: Thu, 08 Dec 2005 15:24:58 +0100 Message-ID: References: <3cc04a73cc1b1a.3cc1b1a3cc04a7@net.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1134060999 29202 80.91.229.2 (8 Dec 2005 16:56:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Dec 2005 16:56:39 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 08 17:56:37 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EkP48-0006D4-3C for ged-emacs-devel@m.gmane.org; Thu, 08 Dec 2005 17:56:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EkP4Q-0003Gh-Dn for ged-emacs-devel@m.gmane.org; Thu, 08 Dec 2005 11:56:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EkMip-0005XI-Eq for emacs-devel@gnu.org; Thu, 08 Dec 2005 09:26:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EkMid-0005Uy-33 for emacs-devel@gnu.org; Thu, 08 Dec 2005 09:26:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EkMic-0005Ui-4I for emacs-devel@gnu.org; Thu, 08 Dec 2005 09:25:58 -0500 Original-Received: from [195.41.46.236] (helo=pfepb.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EkMjd-0000l0-R8 for emacs-devel@gnu.org; Thu, 08 Dec 2005 09:27:02 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepb.post.tele.dk (Postfix) with SMTP id 399E65EE095; Thu, 8 Dec 2005 15:25:35 +0100 (CET) Original-To: LENNART BORGMAN In-Reply-To: <3cc04a73cc1b1a.3cc1b1a3cc04a7@net.lu.se> (LENNART BORGMAN's message of "Thu, 08 Dec 2005 10:32:37 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:47226 Archived-At: LENNART BORGMAN writes: >> Why do you use emulation-mode-map-alist ? > > Because in this case it is a temporary minor mode that exists just > during a few keystrokes. I actually put the keymap first in > emulation-mode-map-alists to avoid any problem. Nearly all keys > except those for using the mode are bound to a function that exits > the temporary mode. That is NOT the purpose of emulation-mode-map-alists, and there must be other ways to accomplish what you want to do. E.g. (not tested): (let (done) (while (not done) (let* ((ev (read-event)) (cmd (lookup-key your-keymap ev))) (if cmd (call-interactively cmd) ; or just funcall (setq done t) (clear-this-command-keys t) (setq unread-command-events (cons ev unread-command-events))))) -- Kim F. Storm http://www.cua.dk