all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* menu-bar key bindings and derived modes
@ 2002-05-05 21:27 Stephen Berman
  0 siblings, 0 replies; only message in thread
From: Stephen Berman @ 2002-05-05 21:27 UTC (permalink / raw)


The following message is a courtesy copy of an article
that has been posted to gnu.emacs.help as well.

I've defined a derived mode of a major mode I'm working on, and for it
a mode-map consisting of key binding definitions that amount to a
proper subset of the major-mode-map key binding definitions.  E.g., I
have something like the following:

(defvar my-major-mode-map
  (let ((map (make-keymap)))
    (define-key map "a" 'my-function-1)
    (define-key map "b" 'my-function-2)
    map))

(defvar my-derived-mode-map
  (let ((map (make-keymap)))
    (define-key map "a" 'my-function-1)
    map))

For the major mode I've defined a menu via easy-menu-define, which
displays e.g. the following entries:

my-function-1           (a)
my-function-2           (b)

When I switch to a buffer which uses the derived mode, the menu bar
still contains the major mode menu, which now looks like this:

my-function-1           (a)
my-function-2

But when I switch back to the major mode buffer, its menu now retains
the latter menu display (i.e., lacking the `b' key binding listing).
This persists for the life of the Emacs session, regardless of whether
I kill the buffers and reload them.  What do I have to do to get the
first menu display when I switch back to the major-mode buffer?

--Steve Berman

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-05 21:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-05 21:27 menu-bar key bindings and derived modes Stephen Berman

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.