all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: emacs-pretest-bug@gnu.org
Subject: easy-menu and key macros
Date: Wed, 23 Apr 2008 17:42:15 -0400	[thread overview]
Message-ID: <9ezlrkckp4.fsf@fencepost.gnu.org> (raw)


Easy-menu doesn't seem to understand key bindings that are strings, ie
keyboard macros.

Compare the following two versions: in bar-mode, which uses
define-key, the "4 lines" menu item works; in foo-mode, which uses
easy-menu-define, it does nothing.


;; This works.
(setq bar-mode-map (make-keymap))
(suppress-keymap bar-mode-map)
(define-key bar-mode-map [menu-bar scroll]
  (cons "Scroll" (make-sparse-keymap "Scroll")))
(define-key bar-mode-map [menu-bar scroll n4]
  '("4 lines" . "4\C-n"))

(define-derived-mode bar-mode fundamental-mode "bar")
(bar-mode)


;; This doesn't.
(setq foo-mode-map (make-keymap))
(suppress-keymap foo-mode-map)
(easy-menu-define nil foo-mode-map nil
   '("Scroll"
     ["4 lines" "4\C-n"]
     ["1 line" next-line]))

(define-derived-mode foo-mode fundamental-mode "foo")
(foo-mode)




             reply	other threads:[~2008-04-23 21:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-23 21:42 Glenn Morris [this message]
2008-04-24  1:57 ` easy-menu and key macros Stefan Monnier
2008-04-24 22:44   ` Glenn Morris
2008-04-25  1:31     ` Stefan Monnier

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=9ezlrkckp4.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    /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.