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

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

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


From: Heime
Subject: RE: [External] : Re: About Package using a menu
Date: Tue, 18 Oct 2022 17:32:31 +0000

------- Original Message -------
On Tuesday, October 18th, 2022 at 3:37 PM, Drew Adams <drew.adams@oracle.com> 
wrote:


> > Is easy-menu-define the only way to make submenus?
> 
> 
> No, of course not. The Elisp manual has a chapter
> that tells you all about defining menus: in node
> "Defining Menus":
> 
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Menus.html
> 
> Easy menu isn't even mentioned in that chapter.

Have been playing with constructing a "Xepty menu" with a "Daphne submenu",  
but how do I make it to display?

;; Make a Daphne submenu

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

(define-key daphne-menu [tags-repl-continue]
  '(menu-item "Continue Replace" multifile-continue
              :help "Continue last tags replace operation"))

(define-key daphne-menu [tags-repl]
  '(menu-item "Replace in tagged files" tags-query-replace
              :help "Interactively replace a regexp in all tagged files"))

(define-key daphne-menu [separator-replace-tags]
  '(menu-item "--"))

(define-key daphne-menu [Xepty]
  (list 'menu-item "Xepty" daphne-menu))

;; Make a Xepty menu

(define-key global-map [xepty-menu words]
  (cons "Xepty" (make-sparse-keymap "Xepty")))

;; Define specific subcommands in this menu.
(define-key global-map [xepty-menu words forward]
  '("Forward word" . forward-word))

(define-key global-map [xepty-menu words backward]
  '("Backward word" . backward-word))

(define-key global-map [C-S-down-mouse-1]
   xepty-menu)






reply via email to

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