From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: menu indications of key bindings for remapped commands Date: Thu, 24 May 2007 17:22:49 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1180042002 6408 80.91.229.12 (24 May 2007 21:26:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 May 2007 21:26:42 +0000 (UTC) Cc: Drew Adams To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 24 23:26:38 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 1HrKpN-0005vf-Eh for ged-emacs-devel@m.gmane.org; Thu, 24 May 2007 23:26:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HrKpQ-000175-6J for ged-emacs-devel@m.gmane.org; Thu, 24 May 2007 17:26:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HrKlu-0007bo-Di for emacs-devel@gnu.org; Thu, 24 May 2007 17:22:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HrKlu-0007bX-0O for emacs-devel@gnu.org; Thu, 24 May 2007 17:22:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HrKlt-0007bQ-Rj for emacs-devel@gnu.org; Thu, 24 May 2007 17:22:57 -0400 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HrKlt-00085p-Ki for emacs-devel@gnu.org; Thu, 24 May 2007 17:22:57 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1HrKll-0002uO-KZ; Thu, 24 May 2007 17:22:49 -0400 In-reply-to: X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:71777 Archived-At: Would someone please fix this and ack? > 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.