help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: RE: [External] : About Package using a menu


From: Christopher Dimech
Subject: Re: RE: [External] : About Package using a menu
Date: Tue, 18 Oct 2022 23:23:27 +0200

> Sent: Wednesday, October 19, 2022 at 8:35 AM
> From: "Drew Adams" <drew.adams@oracle.com>
> To: "Heime" <heimeborgia@protonmail.com>
> Cc: "Christopher Dimech" <dimech@gmx.com>, "Emanuel Berg" 
> <incal@dataswamp.org>, "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> Subject: RE: [External] : Re: About Package using a menu
>
> > Have managed to display a parent menu.
> > Would you holp a bit on how to insert a submenu?
>
> Nope; sorry, too busy.  Hopefully someone else will
> pitch in.  Or maybe you'll find the answer yourself
> first, as you did for your other questions (e.g.,
> how to display a parent menu).

Dear Heime,

Here is a submenu that works as you wish.

(defvar xepty-menu (make-sparse-keymap "xepty"))
(defvar daphne-menu (make-sparse-keymap "daphne"))

;; Here is the xepty parent menu

(define-key-after global-map [menu-bar xepty-menu]
  (cons "Xepty" (make-sparse-keymap "xepty")) 'tools)

;; Here you get the daphne submenu

(define-key-after global-map [menu-bar xepty-menu daphne-menu]
  (cons "Daphne" (make-sparse-keymap "daphne")) 'kill-buffer)

;; Here you append function commands in daphne submenu

(define-key global-map [menu-bar xepty-menu daphne-menu bash]
            '("Bash" . sh-mode))

;; Here you append another function command in daphne submenu

(define-key global-map [menu-bar xepty-menu daphne-menu elisp]
            '("Emacs Lisp" . emacs-lisp-mode))





reply via email to

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