From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: Customising the menu for python-mode Date: Mon, 18 May 2009 12:05:00 +0200 Message-ID: References: <4A02D601.2000107@simplistix.co.uk> <4A09408A.2010108@simplistix.co.uk> <4A0EEFF5.2050903@simplistix.co.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1242641163 15147 80.91.229.12 (18 May 2009 10:06:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 May 2009 10:06:03 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Chris Withers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 18 12:05:56 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M5zjF-0000xN-Py for geh-help-gnu-emacs@m.gmane.org; Mon, 18 May 2009 12:05:54 +0200 Original-Received: from localhost ([127.0.0.1]:60502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M5zjF-0000V9-5Y for geh-help-gnu-emacs@m.gmane.org; Mon, 18 May 2009 06:05:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M5ziV-0000PG-K9 for help-gnu-emacs@gnu.org; Mon, 18 May 2009 06:05:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M5ziT-0000Nu-9n for help-gnu-emacs@gnu.org; Mon, 18 May 2009 06:05:06 -0400 Original-Received: from [199.232.76.173] (port=33000 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M5ziT-0000Nl-1A for help-gnu-emacs@gnu.org; Mon, 18 May 2009 06:05:05 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:33836) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M5ziS-0003nb-BU for help-gnu-emacs@gnu.org; Mon, 18 May 2009 06:05:04 -0400 Original-Received: from thursday (e176228187.adsl.alicedsl.de [85.176.228.187]) by dd18200.kasserver.com (Postfix) with ESMTP id 272DE180296D1; Mon, 18 May 2009 12:05:03 +0200 (CEST) In-Reply-To: <4A0EEFF5.2050903@simplistix.co.uk> (Chris Withers's message of "Sat, 16 May 2009 17:55:17 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64529 Archived-At: Chris Withers wrote: > ;; menu items > (defvar chris-mode-map > (let ((map (make-sparse-keymap))) > (easy-menu-define python-menu map "Python Mode menu" > `("Python" > :help "Python-specific Features" > "-" > ["Comment" python-shift-left :active mark-active > :help "Comment"] > ["Uncomment" python-shift-right :active mark-active > :help "Uncomment"])) > map)) > > Which, while it doesn't error, also does nothing. > > What am I doing wrong? Nothing wrong, just not enough. You've defined a keymap, but you also need to activate it. You can do it like this: (define-minor-mode chris-mode "my menu mode" nil nil chris-mode-map) And then enable `chris-mode'. Of course you can also modify python-mode-map (or whatever it is called) instead of creating your own map, so python-mode will take care of activating the map. regards, Nikolaj Schumacher