From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: minor mode map question Date: Sun, 31 Dec 2006 18:15:26 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1167617802 27326 80.91.229.12 (1 Jan 2007 02:16:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 Jan 2007 02:16:42 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 01 03:16:40 2007 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 1H1Cj8-0007pp-8X for ged-emacs-devel@m.gmane.org; Mon, 01 Jan 2007 03:16:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1Cj7-0000XY-NV for ged-emacs-devel@m.gmane.org; Sun, 31 Dec 2006 21:16:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H1Ciw-0000XT-La for emacs-devel@gnu.org; Sun, 31 Dec 2006 21:16:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H1Civ-0000XG-83 for emacs-devel@gnu.org; Sun, 31 Dec 2006 21:16:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1Civ-0000XD-2t for emacs-devel@gnu.org; Sun, 31 Dec 2006 21:16:25 -0500 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H1Ciu-0000Ev-Ml for emacs-devel@gnu.org; Sun, 31 Dec 2006 21:16:24 -0500 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l012GMrW009461 for ; Sun, 31 Dec 2006 20:16:22 -0600 Original-Received: from rcsmt250.oracle.com (rcsmt250.oracle.com [148.87.90.195]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l011dxds003726 for ; Sun, 31 Dec 2006 19:16:21 -0700 Original-Received: from dhcp-amer-whq-csvpn-gw3-141-144-80-102.vpn.oracle.com by rcsmt250.oracle.com with ESMTP id 2326969111167617728; Sun, 31 Dec 2006 19:15:28 -0700 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= 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:64591 Archived-At: Got no response to my previous email on this, but I figured things out. FYI - The problem was that although the minor-mode map was updated each time the mode was entered, this was not reflected in `minor-mode-map-alist' - that alist continued to have the old keymap. The solution was to delete and re-create the minor-mode entry in `minor-mode-map-alist' each time the mode is entered. That ensures that `substitute-key-definition' respects the current global map, and that is reflected in the minor-mode map. I wish that you could provide, as the cdr of an entry to `minor-mode-map-alist', an expression to be evaled to a keymap value, or perhaps a function that is called to return a keymap value. That would obviate needing to delete and re-add an entry, just to ensure that the alist is up-to-date whenever the keymap changes. It seems a bit weird to me that `minor-mode-map-alist' is so static, given how dynamic Emacs is otherwise. Why not use a keymap-valued variable or keymap-returning function here, instead of an actual keymap?