From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Johnson Newsgroups: gmane.emacs.help Subject: Re: Derived Mode 102 Keybindings and Menu Date: Wed, 22 Mar 2006 01:55:40 -0000 Organization: Alaska Internet Solutions Message-ID: References: <871wwvg2i0.fsf-monnier+gnu.emacs.help@gnu.org> <87k6ancusr.fsf-monnier+gnu.emacs.help@gnu.org> Reply-To: tim@johnsons-web.com NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1143482484 31013 80.91.229.2 (27 Mar 2006 18:01:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Mar 2006 18:01:24 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 27 20:01:20 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FNw1d-0006Cf-4E for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Mar 2006 20:01:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FNw1c-00033z-0v for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Mar 2006 13:01:08 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!news.glorb.com!news2.euro.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!sn-ams-06!sn-xt-ams-08!sn-post-ams-02!sn-post-01!supernews.com!news.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: slrn/0.9.8.0 (Linux) Original-X-Complaints-To: abuse@supernews.com Original-Lines: 36 Original-Xref: shelby.stanford.edu gnu.emacs.help:138316 Original-To: help-gnu-emacs@gnu.org 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:34014 Archived-At: On 2006-03-21, Stefan Monnier wrote: >>> (easy-menu-define foo-menu foo-mode-map "Foo mode menu." >>> '("Foo" >>> [...] >>> [...] >>> ...)) >>> >>> and then in foo-mode you do > >>> (easy-menu-add foo-menu) > >> For cross-compatibility XEmacs needs a more verbose approach, including >> passing the keymap as an argument. > > I've used the above code in sml-mode and AFAIK it worked both in Emacs and > XEmacs. So, I don't think you need "a more verbose approach" for XEmacs. Here's what I have done: ;; toplevel, called from derive-mode form (defun newlisp-menu () "Create Newlisp Menu for emacs/XEmacs" (defvar newlisp-menu-var nil "Newlisp Menu Definition") (easy-menu-define newlisp-menu-var newlisp-keymap "Newlisp Mode Menu" '("Newlisp" ["Test" test-fun])) (easy-menu-add-item nil nil newlisp-menu-var)) ;; Works on both forks. ;; Tried changing (easy-menu-add-item nil nil newlisp-menu-var) to: (easy-menu-add-item newlisp-menu-var) ;; worked on Xemacs not on gnu emacs -- Tim Johnson http://www.alaska-internet-solutions.com