all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Menu functionality
@ 2021-07-09 11:55 lisa-asket
  2021-07-09 12:14 ` tomas
  0 siblings, 1 reply; 18+ messages in thread
From: lisa-asket @ 2021-07-09 11:55 UTC (permalink / raw)
  To: help-gnu-emacs

I would like to have some of my own functionality in the menu bar.  It can be used to execute

my own functions, right?  Where can I find some information on setting menus and calling

my own functions?





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Menu functionality
  2021-07-09 11:55 Menu functionality lisa-asket
@ 2021-07-09 12:14 ` tomas
  2021-07-09 23:25   ` lisa-asket
  0 siblings, 1 reply; 18+ messages in thread
From: tomas @ 2021-07-09 12:14 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

On Fri, Jul 09, 2021 at 01:55:20PM +0200, lisa-asket@perso.be wrote:
> I would like to have some of my own functionality in the menu bar.  It can be used to execute
> 
> my own functions, right?  Where can I find some information on setting menus and calling
> 
> my own functions?

Emacs Lisp manual, "23.17.1 Defining Menus". That's your first hit
when you open the manual and hit `i menu'.

Cheers
 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Menu functionality
  2021-07-09 12:14 ` tomas
@ 2021-07-09 23:25   ` lisa-asket
  2021-07-10  2:47     ` Jean Louis
  0 siblings, 1 reply; 18+ messages in thread
From: lisa-asket @ 2021-07-09 23:25 UTC (permalink / raw)
  To: tomas, help-gnu-emacs

Have started doing a simple menu, and would like some feedback.  



How do I go about introducing a `Menu Separator` and a `Drop-Down Sub-Menu` ?



(define-key-after global-map
  [menu-bar diamer]
  (cons "Diamer" (make-sparse-keymap "hoot hoot"))
  'tools )

;; Creating a menu item, under the menu by the id “[menu-bar diamer]”
(define-key global-map
  [menu-bar diamer nl]
  '("Next Line" . next-line))

(define-key global-map
  [menu-bar diamer pl]
  '("Previous Line" . previous-line))

(define-key global-map
  [menu-bar diamer oes]
  '("Entry Sweep" . gilgamesh-entry-sweep))

(define-key global-map
  [menu-bar diamer ohe]
  '("Hide Entry" . hide-entry))

(define-key global-map
  [menu-bar diamer ose]
  '("Show Entry" . show-entry))

(define-key global-map
  [menu-bar diamer ohb]
  '("Hide Body" . hide-body))

(provide 'diamer)



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Menu functionality
  2021-07-09 23:25   ` lisa-asket
@ 2021-07-10  2:47     ` Jean Louis
  2021-07-10  3:09       ` lisa-asket
  0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2021-07-10  2:47 UTC (permalink / raw)
  To: lisa-asket; +Cc: help-gnu-emacs

Examine documentation for a function `easy-menu-define'

(easy-menu-define wrs-menu  global-map "Website Revision System Menu"
  (list "WRS"
	["Areas of Website Revision System" wrs-areas t]
	["Search pages" wrs-db-search-pages t]
	["Full text search" wrs-db-full-text-search t]
	["Add category" wrs-add-category t]
	["Manage related pages" wrs-related-pages-management t]
	["WRS Templates" wrs-templates-list t]
	["Generate tag clouds" wrs-tag-cloud-for-missing-ogimage t]
	["Publish region as Emacs Lisp function" wrs-publish-emacs-lisp-function t]
	["Publish WWW area" wrs-publish-area t]))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Menu functionality
  2021-07-10  2:47     ` Jean Louis
@ 2021-07-10  3:09       ` lisa-asket
  2021-07-10  3:48         ` lisa-asket
  0 siblings, 1 reply; 18+ messages in thread
From: lisa-asket @ 2021-07-10  3:09 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

How do you show the menu?


From: Jean Louis <bugs@gnu.support>
To: lisa-asket@perso.be
Subject: Re: Menu functionality
Date: 10/07/2021 04:47:06 Europe/Paris
Cc: tomas@tuxteam.de;
   help-gnu-emacs@gnu.org

Examine documentation for a function `easy-menu-define'

(easy-menu-define wrs-menu global-map "Website Revision System Menu"
(list "WRS"
["Areas of Website Revision System" wrs-areas t]
["Search pages" wrs-db-search-pages t]
["Full text search" wrs-db-full-text-search t]
["Add category" wrs-add-category t]
["Manage related pages" wrs-related-pages-management t]
["WRS Templates" wrs-templates-list t]
["Generate tag clouds" wrs-tag-cloud-for-missing-ogimage t]
["Publish region as Emacs Lisp function" wrs-publish-emacs-lisp-function t]
["Publish WWW area" wrs-publish-area t]))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Menu functionality
  2021-07-10  3:09       ` lisa-asket
@ 2021-07-10  3:48         ` lisa-asket
  2021-07-10  4:07           ` lisa-asket
  2021-07-10  4:14           ` Jean Louis
  0 siblings, 2 replies; 18+ messages in thread
From: lisa-asket @ 2021-07-10  3:48 UTC (permalink / raw)
  To: lisa-asket, Jean Louis; +Cc: help-gnu-emacs

Have now seen it being displayed.  It is a simple menu without displaying keybindings and mouse help string.


From: lisa-asket@perso.be
To: Jean Louis <bugs@gnu.support>
Subject: Menu functionality
Date: 10/07/2021 05:09:53 Europe/Paris
Cc: help-gnu-emacs@gnu.org

How do you show the menu?


From: Jean Louis <bugs@gnu.support>
To: lisa-asket@perso.be
Subject: Re: Menu functionality
Date: 10/07/2021 04:47:06 Europe/Paris
Cc: tomas@tuxteam.de;
   help-gnu-emacs@gnu.org

Examine documentation for a function `easy-menu-define'

(easy-menu-define wrs-menu global-map "Website Revision System Menu"
(list "WRS"
["Areas of Website Revision System" wrs-areas t]
["Search pages" wrs-db-search-pages t]
["Full text search" wrs-db-full-text-search t]
["Add category" wrs-add-category t]
["Manage related pages" wrs-related-pages-management t]
["WRS Templates" wrs-templates-list t]
["Generate tag clouds" wrs-tag-cloud-for-missing-ogimage t]
["Publish region as Emacs Lisp function" wrs-publish-emacs-lisp-function t]
["Publish WWW area" wrs-publish-area t]))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Menu functionality
  2021-07-10  3:48         ` lisa-asket
@ 2021-07-10  4:07           ` lisa-asket
  2021-07-10  4:14           ` Jean Louis
  1 sibling, 0 replies; 18+ messages in thread
From: lisa-asket @ 2021-07-10  4:07 UTC (permalink / raw)
  To: lisa-asket, Jean Louis; +Cc: help-gnu-emacs

Am trying to display a string when the mouse pointer is placed on a menu item.


From: lisa-asket@perso.be
To: lisa-asket@perso.be;
   Jean Louis <bugs@gnu.support>
Subject: Menu functionality
Date: 10/07/2021 05:48:31 Europe/Paris
Cc: help-gnu-emacs@gnu.org

Have now seen it being displayed.  It is a simple menu without displaying keybindings and mouse help string.


From: lisa-asket@perso.be
To: Jean Louis <bugs@gnu.support>
Subject: Menu functionality
Date: 10/07/2021 05:09:53 Europe/Paris
Cc: help-gnu-emacs@gnu.org

How do you show the menu?


From: Jean Louis <bugs@gnu.support>
To: lisa-asket@perso.be
Subject: Re: Menu functionality
Date: 10/07/2021 04:47:06 Europe/Paris
Cc: tomas@tuxteam.de;
   help-gnu-emacs@gnu.org

Examine documentation for a function `easy-menu-define'

(easy-menu-define wrs-menu global-map "Website Revision System Menu"
(list "WRS"
["Areas of Website Revision System" wrs-areas t]
["Search pages" wrs-db-search-pages t]
["Full text search" wrs-db-full-text-search t]
["Add category" wrs-add-category t]
["Manage related pages" wrs-related-pages-management t]
["WRS Templates" wrs-templates-list t]
["Generate tag clouds" wrs-tag-cloud-for-missing-ogimage t]
["Publish region as Emacs Lisp function" wrs-publish-emacs-lisp-function t]
["Publish WWW area" wrs-publish-area t]))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Menu functionality
  2021-07-10  3:48         ` lisa-asket
  2021-07-10  4:07           ` lisa-asket
@ 2021-07-10  4:14           ` Jean Louis
  2021-07-10  4:36             ` lisa-asket
  2021-07-10  4:39             ` lisa-asket
  1 sibling, 2 replies; 18+ messages in thread
From: Jean Louis @ 2021-07-10  4:14 UTC (permalink / raw)
  To: lisa-asket; +Cc: help-gnu-emacs

* lisa-asket@perso.be <lisa-asket@perso.be> [2021-07-10 06:49]:
> Have now seen it being displayed.  It is a simple menu without
> displaying keybindings and mouse help string.

Once you assign key binding it will show it automatically.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Menu functionality
  2021-07-10  4:14           ` Jean Louis
@ 2021-07-10  4:36             ` lisa-asket
  2021-07-10  4:39             ` lisa-asket
  1 sibling, 0 replies; 18+ messages in thread
From: lisa-asket @ 2021-07-10  4:36 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

I looked deeper and you are correct.  I was calling a few functions where I had not set up my own

keybindings for them. 


From: Jean Louis <bugs@gnu.support>
To: lisa-asket@perso.be
Subject: Re: Menu functionality
Date: 10/07/2021 06:14:28 Europe/Paris
Cc: help-gnu-emacs@gnu.org

* lisa-asket@perso.be <lisa-asket@perso.be> [2021-07-10 06:49]:
> Have now seen it being displayed.  It is a simple menu without
> displaying keybindings and mouse help string.

Once you assign key binding it will show it automatically.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Menu functionality
  2021-07-10  4:14           ` Jean Louis
  2021-07-10  4:36             ` lisa-asket
@ 2021-07-10  4:39             ` lisa-asket
  2021-07-10  4:56               ` Jean Louis
  1 sibling, 1 reply; 18+ messages in thread
From: lisa-asket @ 2021-07-10  4:39 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

I have been doing 



(define-key global-map
  [menu-bar diamer diamer-hide-body]

  '("Hide Body" . hide-body))



Still, perhaps using `menu-item` could makes implementation better.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Menu functionality
  2021-07-10  4:39             ` lisa-asket
@ 2021-07-10  4:56               ` Jean Louis
  2021-07-10  5:06                 ` lisa-asket
  0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2021-07-10  4:56 UTC (permalink / raw)
  To: lisa-asket; +Cc: help-gnu-emacs

* lisa-asket@perso.be <lisa-asket@perso.be> [2021-07-10 07:39]:
> I have been doing 

> (define-key global-map
>   [menu-bar diamer diamer-hide-body]
>   '("Hide Body" . hide-body))
> 
> Still, perhaps using `menu-item` could makes implementation better.

I understand that rather that you have got difficulties and you would
prefer personalized programming service to make it easier to your own
frame or viewpoint on how it should be.  In general anything could be
better, we have no use of hypothetical statements. Best way to show
what is better is to make it, at least to give design proposal.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Menu functionality
  2021-07-10  4:56               ` Jean Louis
@ 2021-07-10  5:06                 ` lisa-asket
  2021-07-10  5:41                   ` Jean Louis
  0 siblings, 1 reply; 18+ messages in thread
From: lisa-asket @ 2021-07-10  5:06 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

All help questions are personalised, don't you think?



Have done as follows.  In the last one I used `menu-item`.  I am new to this and

only been playing with menus a couple of days. Criticism could do some good.







--------



(define-key-after global-map
  [menu-bar diamer]
  (cons "Diamer" (make-sparse-keymap "Nanga Parbat"))
  'tools )

;; Make menu item, under the menu by the id “[menu-bar diamer]”
(define-key global-map [menu-bar diamer diamer-next-line]
  '("Next Line" . next-line))

(define-key global-map [menu-bar diamer diamer-previous-line]
  '("Previous Line" . previous-line))

(define-key global-map [menu-bar diamer diamer-entry-sweep]
  '("Entry Sweep" . gilgamesh-entry-sweep))

(define-key global-map [menu-bar diamer diamer-hide-entry]
  '("Hide Entry" . hide-entry))

(define-key global-map [menu-bar diamer diamer-show-entry]
  '("Show Entry" . show-entry))

(define-key global-map [menu-bar diamer diamer-hide-body]
  '("Hide Body" . hide-body))

(define-key global-map [menu-bar diamer diamer-pdf]
  '("Faddeev Pdf" . faddeev-pdf))

(define-key global-map [menu-bar diamer diammer-htm]
  '("Faddeev Htm" . faddeev-htm))

(define-key global-map [menu-bar diamer diammer-html]
  '(menu-item "Hide Body" outline-hide-body
          :help "Hide all body lines in buffer"))



From: Jean Louis <bugs@gnu.support>
To: lisa-asket@perso.be
Subject: Re: Menu functionality
Date: 10/07/2021 06:56:12 Europe/Paris
Cc: help-gnu-emacs@gnu.org

* lisa-asket@perso.be <lisa-asket@perso.be> [2021-07-10 07:39]:
> I have been doing 

> (define-key global-map
>   [menu-bar diamer diamer-hide-body]
>   '("Hide Body" . hide-body))
> 
> Still, perhaps using `menu-item` could makes implementation better.

I understand that rather that you have got difficulties and you would
prefer personalized programming service to make it easier to your own
frame or viewpoint on how it should be. In general anything could be
better, we have no use of hypothetical statements. Best way to show
what is better is to make it, at least to give design proposal.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Menu functionality
  2021-07-10  5:06                 ` lisa-asket
@ 2021-07-10  5:41                   ` Jean Louis
  2021-07-10  5:52                     ` Beauty of Emacs Lisp Jean Louis
  2021-07-10  5:59                     ` Menu functionality lisa-asket
  0 siblings, 2 replies; 18+ messages in thread
From: Jean Louis @ 2021-07-10  5:41 UTC (permalink / raw)
  To: lisa-asket; +Cc: help-gnu-emacs

* lisa-asket@perso.be <lisa-asket@perso.be> [2021-07-10 08:07]:
> All help questions are personalised, don't you think?

> Have done as follows.  In the last one I used `menu-item`.  I am new
> to this and only been playing with menus a couple of days. Criticism
> could do some good.

I am also new to this. Your criticism need to provide some help to
reader or lacks usefulness, it should not tend to blaming.

Learning will go slow through Emacs Lisp manual only and people need
to interact with others to get more or better, mailing list is
attended by helpful people.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Beauty of Emacs Lisp
  2021-07-10  5:41                   ` Jean Louis
@ 2021-07-10  5:52                     ` Jean Louis
  2021-07-10  6:17                       ` Christopher Dimech
  2021-07-10  5:59                     ` Menu functionality lisa-asket
  1 sibling, 1 reply; 18+ messages in thread
From: Jean Louis @ 2021-07-10  5:52 UTC (permalink / raw)
  To: lisa-asket, help-gnu-emacs

Beautiful programming language Emacs Lisp is very helpful and
assistive to human, integrated with editor and graphical user
interface that easy the tasks for computer user. Emacs Lisp can even
handle it's own and your own development workflow - as it has it's own
IDE.

To make your application well integrated, I highly recommend Emacs
Lisp in all its glory. By learning Emacs Lisp, we can make a more
complete project with less time to setup & maintain. In addition to
Emacs Lisp, you also can use Emacs as a tool to solve problems that
may never be solved using any other programming environment.

We also are always working towards making a better user experience for
the program user. The only problem we have with it is that there are
some big and unexpected challenges that need to be worked out to
optimize the performance.

Please don't hesitate to ask us to help you for your project. The goal
is not to solve some major technical challenges. You simply have to
find ways to solve this problem in Emacs Lisp and help it improve in
general. As of now, if you have any need for advanced code on Emacs
Lisp in future releases, we recommend you to ask us to help you as
well. We are confident we can solve your problems with our own help.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/

P.S. There is truth inside, the above has been to 98% generated by AI.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Menu functionality
  2021-07-10  5:41                   ` Jean Louis
  2021-07-10  5:52                     ` Beauty of Emacs Lisp Jean Louis
@ 2021-07-10  5:59                     ` lisa-asket
  2021-07-10 17:44                       ` Jean Louis
  1 sibling, 1 reply; 18+ messages in thread
From: lisa-asket @ 2021-07-10  5:59 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

>From: Jean Louis <bugs@gnu.support>
>To: lisa-asket@perso.be
>Subject: Re: Menu functionality
>Date: 10/07/2021 07:41:38 Europe/Paris
>Cc: help-gnu-emacs@gnu.org

>* lisa-asket@perso.be <lisa-asket@perso.be> [2021-07-10 08:07]:
>> All help questions are personalised, don't you think?

> Have done as follows.  In the last one I used `menu-item`.  I am new
> to this and only been playing with menus a couple of days. Criticism
> could do some good.

>I am also new to this. Your criticism need to provide some help to
>reader or lacks usefulness, it should not tend to blaming.



Who did I blame exactly? Never said my code was great.



Have been trying to make a submenu.  To start I used your easy-menu way



(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]) )) )



Have been able to add some help when using the mouse using



(define-key global-map [menu-bar diamer diammer-htm]
  '(menu-item "Hide Body" outline-hide-body
          :help "Hide all body lines in buffer"))



rather than keeping with the following



(define-key global-map [menu-bar diamer diamer-hide-body]
  '("Hide Body" . hide-body))




>Learning will go slow through Emacs Lisp manual only and people need
>to interact with others to get more or better, mailing list is
>attended by helpful people.



I think many could learn from this as information en making working menus

is scant.







^ permalink raw reply	[flat|nested] 18+ messages in thread

* Beauty of Emacs Lisp
  2021-07-10  5:52                     ` Beauty of Emacs Lisp Jean Louis
@ 2021-07-10  6:17                       ` Christopher Dimech
  0 siblings, 0 replies; 18+ messages in thread
From: Christopher Dimech @ 2021-07-10  6:17 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs, lisa-asket


One thing to work on is outline-minor-mode as it has not been fully completed.

There are a couple of things

1. Get Outline Levels to use a different colour according to level.
2. There does not seem to be a default setup for sh-mode.
3. Separate code headings from user defined headings

Task 3 would help users collect a number of defuns or region into a
heading or subheading, so that the code could be better organsised.

Perhaps the only thing a lisp expression starting with `(` un the first
column would be to to only have show-entry and hide-entry.

Felicitations
Christopher


> Sent: Saturday, July 10, 2021 at 5:52 PM
> From: "Jean Louis" <bugs@gnu.support>
> To: lisa-asket@perso.be, help-gnu-emacs@gnu.org
> Subject: Beauty of Emacs Lisp
>
> Beautiful programming language Emacs Lisp is very helpful and
> assistive to human, integrated with editor and graphical user
> interface that easy the tasks for computer user. Emacs Lisp can even
> handle it's own and your own development workflow - as it has it's own
> IDE.
>
> To make your application well integrated, I highly recommend Emacs
> Lisp in all its glory. By learning Emacs Lisp, we can make a more
> complete project with less time to setup & maintain. In addition to
> Emacs Lisp, you also can use Emacs as a tool to solve problems that
> may never be solved using any other programming environment.
>
> We also are always working towards making a better user experience for
> the program user. The only problem we have with it is that there are
> some big and unexpected challenges that need to be worked out to
> optimize the performance.
>
> Please don't hesitate to ask us to help you for your project. The goal
> is not to solve some major technical challenges. You simply have to
> find ways to solve this problem in Emacs Lisp and help it improve in
> general. As of now, if you have any need for advanced code on Emacs
> Lisp in future releases, we recommend you to ask us to help you as
> well. We are confident we can solve your problems with our own help.
>
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> In support of Richard M. Stallman
> https://stallmansupport.org/
>
> P.S. There is truth inside, the above has been to 98% generated by AI.
>
>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Menu functionality
  2021-07-10  5:59                     ` Menu functionality lisa-asket
@ 2021-07-10 17:44                       ` Jean Louis
  2021-07-10 19:21                         ` lisa-asket
  0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2021-07-10 17:44 UTC (permalink / raw)
  To: lisa-asket; +Cc: help-gnu-emacs

* lisa-asket@perso.be <lisa-asket@perso.be> [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 t]
	["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"
	    hyperscope-menu-list-hyperdocuments
	    hyperscope-menu-current-hyperdocument
	    hyperscope-menu-find-hyperdocuments
	    hyperscope-menu-collaborate
	    hyperscope-menu-add-hyperdocuments
	    hyperscope-menu-edit-hyperdocument
	    hyperscope-menu-deleting-hyperdocuments
	    hyperscope-menu-meta-functions
	    ["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.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Menu functionality
  2021-07-10 17:44                       ` Jean Louis
@ 2021-07-10 19:21                         ` lisa-asket
  0 siblings, 0 replies; 18+ messages in thread
From: lisa-asket @ 2021-07-10 19:21 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

Is it possible for  easy-menu-define te inject the menu at a particular location in the menubar.

Currently the menu is being inserted before the file menu.



From: Jean Louis <bugs@gnu.support>
To: lisa-asket@perso.be
Subject: Re: Menu functionality
Date: 10/07/2021 19:44:15 Europe/Paris
Cc: help-gnu-emacs@gnu.org

* lisa-asket@perso.be <lisa-asket@perso.be> [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 t]
["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"
hyperscope-menu-list-hyperdocuments
hyperscope-menu-current-hyperdocument
hyperscope-menu-find-hyperdocuments
hyperscope-menu-collaborate
hyperscope-menu-add-hyperdocuments
hyperscope-menu-edit-hyperdocument
hyperscope-menu-deleting-hyperdocuments
hyperscope-menu-meta-functions
["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.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-07-10 19:21 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-09 11:55 Menu functionality lisa-asket
2021-07-09 12:14 ` tomas
2021-07-09 23:25   ` lisa-asket
2021-07-10  2:47     ` Jean Louis
2021-07-10  3:09       ` lisa-asket
2021-07-10  3:48         ` lisa-asket
2021-07-10  4:07           ` lisa-asket
2021-07-10  4:14           ` Jean Louis
2021-07-10  4:36             ` lisa-asket
2021-07-10  4:39             ` lisa-asket
2021-07-10  4:56               ` Jean Louis
2021-07-10  5:06                 ` lisa-asket
2021-07-10  5:41                   ` Jean Louis
2021-07-10  5:52                     ` Beauty of Emacs Lisp Jean Louis
2021-07-10  6:17                       ` Christopher Dimech
2021-07-10  5:59                     ` Menu functionality lisa-asket
2021-07-10 17:44                       ` Jean Louis
2021-07-10 19:21                         ` lisa-asket

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.