unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim Johnson <tim@johnsons-web.com>
Subject: Re: Derived Mode 102 Keybindings and Menu
Date: Wed, 22 Mar 2006 01:55:40 -0000	[thread overview]
Message-ID: <slrne21a68.je4.tim@linus.johnson.com> (raw)
In-Reply-To: 87k6ancusr.fsf-monnier+gnu.emacs.help@gnu.org

On 2006-03-21, Stefan Monnier <monnier@iro.umontreal.ca> 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 <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com

  reply	other threads:[~2006-03-22  1:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-17 22:56 Derived Mode 102 Keybindings and Menu Tim Johnson
2006-03-21 17:01 ` Stefan Monnier
2006-03-21 20:55   ` Tim Johnson
2006-03-21 22:13     ` Stefan Monnier
2006-03-22  1:55       ` Tim Johnson [this message]
2006-03-22  3:55         ` Tim Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrne21a68.je4.tim@linus.johnson.com \
    --to=tim@johnsons-web.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).