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: menu indications of key bindings for remapped commands Date: Mon, 22 Jan 2007 11:44:22 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169495207 14520 80.91.229.12 (22 Jan 2007 19:46:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Jan 2007 19:46:47 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 22 20:46:44 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 1H957m-0007pR-V1 for ged-emacs-devel@m.gmane.org; Mon, 22 Jan 2007 20:46:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H957m-0007Ff-Hg for ged-emacs-devel@m.gmane.org; Mon, 22 Jan 2007 14:46:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H957T-0007Bi-EJ for emacs-devel@gnu.org; Mon, 22 Jan 2007 14:46:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H957R-0007B9-Lo for emacs-devel@gnu.org; Mon, 22 Jan 2007 14:46:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H957R-0007B1-BX for emacs-devel@gnu.org; Mon, 22 Jan 2007 14:46:17 -0500 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H957P-0005qC-Op for emacs-devel@gnu.org; Mon, 22 Jan 2007 14:46:16 -0500 Original-Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.186.112]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l0MJkDl9023612 for ; Mon, 22 Jan 2007 12:46:13 -0700 Original-Received: from rcsmt250.oracle.com (rcsmt250.oracle.com [148.87.90.195]) by rgmgw3.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l0MJkBsD013339 for ; Mon, 22 Jan 2007 12:46:11 -0700 Original-Received: from dhcp-4op11-4op12-west-130-35-178-179.us.oracle.com by rcsmt250.oracle.com with ESMTP id 2385554681169495063; Mon, 22 Jan 2007 12:44:23 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-reply-to: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE 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:65385 Archived-At: > > It's a bug. > > Could you give a test case? > > See my previous mail. Just create a menu using a command that is the > *target* of a command remapping. > > That is not a test case, that is a general description. A test case > is code we can execute and see the failure. Try this in emacs -Q (defvar bar-mode-map (make-sparse-keymap) "Keymap for Bar mode.") (defvar bar-menu-map (make-sparse-keymap "Bar") "Keymap for Bar menu.") (define-key bar-mode-map [menu-bar bar] (cons "Bar" bar-menu-map)) (define-key bar-mode-map [remap switch-to-buffer] 'bar-buffer) ;; This way, the key binding shows incorrectly in the menu. (define-key bar-menu-map [bar-buffer] '("Bar Buffer..." . bar-buffer)) ;; This way, the key binding shows correctly in the menu. ;;(define-key bar-menu-map [bar-buffer] ;; '("Bar Buffer..." . switch-to-buffer)) (define-minor-mode bar-mode "Bar mode") M-x bar-mode You'll see the bad menu item (bad key-binding description) in menu Bar. Now execute the commented code. The menu item is now as it should be. -- Interestingly, this apparently has something to do with the minor-mode map, because similar code using the global map does not have the same problem. It shows, however, no binding at all in the menu item. (defvar foo-menu-map (make-sparse-keymap "Foo") "Keymap for Foo menu.") (define-key global-map [menu-bar foo] (cons "Foo" foo-menu-map)) (define-key global-map [remap switch-to-buffer] 'foo-buffer) ;; This way, there is no key binding in the menu. (define-key foo-menu-map [foo-buffer] '("Foo Buffer..." . foo-buffer)) ;; This way, the key binding shows correctly in the menu. ;;(define-key foo-menu-map [foo-buffer] ;; '("Foo Buffer..." . switch-to-buffer))