[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

easy-menu and key macros

From: Glenn Morris
Subject: easy-menu and key macros
Date: Wed, 23 Apr 2008 17:42:15 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

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")

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]