[Top][All Lists]

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

Re: Menu functionality

From: Jean Louis
Subject: Re: Menu functionality
Date: Sat, 10 Jul 2021 20:44:15 +0300
User-agent: Mutt/2.0.7+183 (3d24855) (2021-05-28)

* <> [2021-07-10 08:59]:
> (defun my-easy-menu ()
>   ""
>   (easy-menu-define rupal global-map "Rupal"
>     (list "Rupal"
>       ["Entry Sweep" entry-sweep t]
>       ["Hide Entry"  hide-entry t]
>       ["Show Entry"  show-entry t]
>       ["Hide Body"   hide-body t]
>       ("Sub Menu"
>        ["Texinfo Pdf" texinfo-pdf t]
>        ["Texinfo Htm" texinfo-htm t]) )) )

I have used it even without the `defun', just `easy-menu-define'
alone. This is because when I load specific file then
`easy-menu-define' is invoked and I get the menu. Otherwise if it is
part of special mode it is then invoked in that special mode.

I also define multiple sub-menus this way:

(defvar hyperscope-menu-list-hyperdocuments
  (list "List hyperdocuments"
        ["List action hyperdocuments action" hyperscope-all-actions t]
        ["List assigned action hyperdocuments" hyperscope-list-assigned-actions 
        ["List published hyperdocuments" 
hyperscope-list-published-hyperdocuments t]
        ["Actions pending by assignee" 
hyperscope-hyperdocuments-pending-by-assignee t]
        ["Latest hyperdocuments" hyperscope-latest-entries t]
        ["List by rank"  hyperscope-by-rank t]
        ["List user set" hyperscope-list-user-set t]))

(defvar hyperscope-menu-current-hyperdocument
  '("Current hyperdocument"
    ["Show description for hyperdocument" hyperscope-description-show t]
    ["Duplicate hyperdocument" hyperscope-copy-hyperdocument t]
    ["Preview HTML" hyperscope-hyperdocument-preview t]
    ["Open directory" hyperscope-dired t]
    ["Remove mark" hyperscope-unmark-id t]
    ["Sort hyperdocuments alphabetically" hyperscope-sort-alphabetically t]
    ["Go back" hyperscope-go-back t]
    ["Go back to real parent" hlink-go-to-parent t]))

imagine multiple such as above here.................

then final that integrates them all:

   (easy-menu-define hyperscope-menu map "Hyperscope Menu"
      (list "Hyperscope"
            ["About Hyperscope" hyperscope-about t]
            ["Quit" quit-window t]))

I can say that `easy-menu' truly deserves its easy adjective as when I
compare it to various GUI toolkits that are normally invoked from
Common Lisp or Scheme implementations. A menu in Emacs means much for
the user as it offers quick access, it is helpful as it shows key
bindings, it gives some structure on how user could proceed with
possible actions.

> I think many could learn from this as information en making working
> menus is scant.

I have used just Emasc Lisp manual.


Take action in Free Software Foundation campaigns:

In support of Richard M. Stallman

reply via email to

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