all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Johnson <tim@johnsons-web.com>
Subject: Re: Derived Mode 102 Keybindings and Menu
Date: Wed, 22 Mar 2006 03:55:39 -0000	[thread overview]
Message-ID: <slrne21gm2.jrm.tim@linus.johnson.com> (raw)
In-Reply-To: slrne21a68.je4.tim@linus.johnson.com

On 2006-03-22, Tim Johnson <tim@johnsons-web.com> wrote:
The previous posting had a typo: see below
> 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:
;; typo below
>   (easy-menu-add-item newlisp-menu-var)
;; should have been
   (easy-menu-add newlisp-menu-var)
;; Sorry!

>   ;; 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  3: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
2006-03-22  3:55         ` Tim Johnson [this message]

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

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

  git send-email \
    --in-reply-to=slrne21gm2.jrm.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.