From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Function for deleting a key binding in a sparse keymap Date: Wed, 07 Dec 2005 00:01:30 +0100 Message-ID: <4396184A.60606@student.lu.se> References: <439382B9.7020802@student.lu.se> <439470ED.9010809@student.lu.se> <4395C4BA.4070707@student.lu.se> <43960E3F.1060105@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1133910756 15315 80.91.229.2 (6 Dec 2005 23:12:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2005 23:12:36 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 07 00:12:34 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ejlxw-0002St-4x for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2005 00:11:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ejly8-00059d-Sv for ged-emacs-devel@m.gmane.org; Tue, 06 Dec 2005 18:11:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ejlop-0006kL-AQ for emacs-devel@gnu.org; Tue, 06 Dec 2005 18:01:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ejlom-0006jB-9j for emacs-devel@gnu.org; Tue, 06 Dec 2005 18:01:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ejloi-0006hl-2Z for emacs-devel@gnu.org; Tue, 06 Dec 2005 18:01:48 -0500 Original-Received: from [81.228.11.159] (helo=pne-smtpout2-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EjlpR-0003iq-EL; Tue, 06 Dec 2005 18:02:33 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout2-sn1.fre.skanova.net (7.2.069.1) id 4394B97C0005364B; Wed, 7 Dec 2005 00:01:31 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: Stefan Monnier In-Reply-To: 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:47082 Archived-At: Stefan Monnier wrote: >>>>The next time I enter that minor mode the key definitions outside may >>>>however be different so I want to remove the key bindings I added when >>>>exiting the minor mode. >>>> >>>> >>>Why not set them to nil? >>> >>> >>They should have the default value in those cases. A workaround is of >>course to set them to the default value. >> >> > >What default value? Please, make your concrete example concrete. > > > > I feel a bit stupid because this example is not terribly important. However this is what I do. There is a minor mode where I use this, bw-window-resize-mode. When entering this mode I do: (mapc (lambda(key) (define-key bw-keymap (vector key) nil)) help-event-list) I set the "help keys" to nil so that the help is still available during resizing. Those are the keys I want to remove afterwards. The default value in the sparse keymap bw-keymap is: (define-key bw-keymap [t] 'bw-exit-resize-mode) Since Richard just decided that this part of the window resizing is new and therefore should not go with our next release it is of less importance now. However I do believe that it still would be good to add that function (see subject line) now.