all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* easy-menu and key macros
@ 2008-04-23 21:42 Glenn Morris
  2008-04-24  1:57 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2008-04-23 21:42 UTC (permalink / raw)
  To: emacs-pretest-bug


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)




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-25  1:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-23 21:42 easy-menu and key macros Glenn Morris
2008-04-24  1:57 ` Stefan Monnier
2008-04-24 22:44   ` Glenn Morris
2008-04-25  1:31     ` Stefan Monnier

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.