unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Submenu with easy-menu-define yielding invalid menu item
@ 2022-10-19  1:44 Heime via Users list for the GNU Emacs text editor
  2022-10-19  2:49 ` Emanuel Berg
  2022-10-19 11:51 ` Sharon Kimble
  0 siblings, 2 replies; 7+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2022-10-19  1:44 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

I am making menus with "easy-menu-define". But I am having difficulty calling the submenu "dingo-outline-subm"
from "easy-menu-define". Would appreciate some assistance figuring out the problem.

The error captured is

Lisp error: (error "Invalid menu item in easymenu")

---------------------

;; Make submenu outline

(defvar dingo-outline-subm

'("Outline"

["Hide Direct Body" outline-hide-entry :help "Hide Entry"]

["Expose Direct Body" outline-show-entry :help "Show Entry"]

["Expose Headings" outline-hide-body :help "Hide Body"])

"Submenu giving outline capability.")

;; Make top menu dingo

(defun dingo-easym ()

"Dingo easy menu."

(easy-menu-define dingo-menu global-map "Dingo"

'("Dingo"

dingo-outline-subm

["Hide Entry" outline-hide-entry t]

["Show Entry" outline-show-entry t]

["Hide Body" outline-hide-body t])) )

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

* Re: Submenu with easy-menu-define yielding invalid menu item
  2022-10-19  1:44 Submenu with easy-menu-define yielding invalid menu item Heime via Users list for the GNU Emacs text editor
@ 2022-10-19  2:49 ` Emanuel Berg
  2022-10-19 14:33   ` Heime
  2022-10-19 11:51 ` Sharon Kimble
  1 sibling, 1 reply; 7+ messages in thread
From: Emanuel Berg @ 2022-10-19  2:49 UTC (permalink / raw)
  To: help-gnu-emacs

Heime via Users list for the GNU Emacs text editor wrote:

> I am making menus with "easy-menu-define". But I am having
> difficulty calling the submenu "dingo-outline-subm"
> from "easy-menu-define". Would appreciate some assistance
> figuring out the problem.
>
> The error captured is
>
> Lisp error: (error "Invalid menu item in easymenu")

Make a smaller menu that works and increase the size from
there ...

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Submenu with easy-menu-define yielding invalid menu item
  2022-10-19  1:44 Submenu with easy-menu-define yielding invalid menu item Heime via Users list for the GNU Emacs text editor
  2022-10-19  2:49 ` Emanuel Berg
@ 2022-10-19 11:51 ` Sharon Kimble
  2022-10-19 12:49   ` Emanuel Berg
  2022-10-19 21:04   ` Heime
  1 sibling, 2 replies; 7+ messages in thread
From: Sharon Kimble @ 2022-10-19 11:51 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor; +Cc: Heime

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:

> I am making menus with "easy-menu-define". But I am having difficulty calling the submenu "dingo-outline-subm"
> from "easy-menu-define". Would appreciate some assistance figuring out the problem.
>
> The error captured is
>
> Lisp error: (error "Invalid menu item in easymenu")
>
> ---------------------
>
> ;; Make submenu outline
>
> (defvar dingo-outline-subm
>
> '("Outline"
>
> ["Hide Direct Body" outline-hide-entry :help "Hide Entry"]
>
> ["Expose Direct Body" outline-show-entry :help "Show Entry"]
>
> ["Expose Headings" outline-hide-body :help "Hide Body"])
>
> "Submenu giving outline capability.")
>
> ;; Make top menu dingo
>
> (defun dingo-easym ()
>
> "Dingo easy menu."
>
> (easy-menu-define dingo-menu global-map "Dingo"
>
> '("Dingo"
>
> dingo-outline-subm
>
> ["Hide Entry" outline-hide-entry t]
>
> ["Show Entry" outline-show-entry t]
>
> ["Hide Body" outline-hide-body t])) )

If it helps this is a very small part of my 'easy-menu'

=====
(easy-menu-define sk-menu global-map "menu"
  '("Mono"
    ("Misc" ;; submenu
     ["Wrap Text" auto-fill-mode]
     ["Get colours" list-colors-display]
     ["Delete this file" delete-this-file]
     ["call paradox - package manager" paradox-list-packages]
     ["Show my cheatsheet" cheatsheet-show]
     ["typewriter-mode" centered-cursor-mode]
     ["Tea brewing time" tea-timer]
     ["Show current key-bindings" show-key-command]
     ["Set the font size" set-font-size]    

     )
    ))  
=====

And its been in constant use since November 2014!

Hope it helps, and if you need further guidance then please ask?    

Thanks
  Sharon.  
- -- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 11.5, fluxbox 1.3.7, emacs 29.0.50, org 9.5.5 
-----BEGIN PGP SIGNATURE-----

iQJRBAEBCgA7FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmNP5M0dHGJvdWRpY2Nh
c0Bza2ltYmxlMDkucGx1cy5jb20ACgkQNoGAGQr4g1tKSQ//amHIAh+Xejx0rPNi
pPabd884KqO84+1zMVtpPfunAKCfXXJhlZSPkwS2VZmaJb0g4SkIYxc7ts+0jyRw
jU7KncQ2GSL4jIVQWQOQwV/TyXbvC/hJSQcEddyArCUS0b7Q8kx+hB1TqQel8yUg
TQX3zm4wyOwOS97yZBUxTlwshCRs0XfhLrcK4iiUpavogK7o6Kqgqf1WUft1a8ZY
MGfNG1SPpa9C0f0+lIasZ2eFOiwfZHXotXM0//3vNtYALKKKf1vUSHCMRT1HjPLW
xlRopdQQjiL5eVxjICcrkPKl1wZyfQGR/F1UEW1TOcF2RJ6mfzp/eZSnFNm0cpHk
deXJ5nau+ZGpPJAmuzW38EcQqP82wlim0yuwhopinqFUBucdl10gDKqSuVQhI5HR
LdYb8lV07dKrnD4MkHBcmmx4qRABCWepIS/CjFMUyYaZzbcJFKeHsLu82kv4z4kD
oA0a0Cv72e44NQR92Mi1HViW3/aA3Ut3CeGMN04hhqcIrcDEr6ADP9hikHB1Yg0P
ptEciyeTUt4aIfM6vsSfyTwO9xqKS46cQXEHdh0vcrmcMruwxS4NXkECO14i3si9
+qlwl6J7JFqxPZoDm5n98ICljey5XCJdZjGXH3yWOCh998gn9UT+KC0RV6umhbw8
De0eQ9rwbzF7rhKMQJQgw/QlweE=
=S/wT
-----END PGP SIGNATURE-----



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

* Re: Submenu with easy-menu-define yielding invalid menu item
  2022-10-19 11:51 ` Sharon Kimble
@ 2022-10-19 12:49   ` Emanuel Berg
  2022-10-19 20:23     ` Heime
  2022-10-19 21:04   ` Heime
  1 sibling, 1 reply; 7+ messages in thread
From: Emanuel Berg @ 2022-10-19 12:49 UTC (permalink / raw)
  To: help-gnu-emacs

Sharon Kimble wrote:

> ["call paradox - package manager" paradox-list-packages]

Call it poison!

https://www.youtube.com/watch?v=xA6DtpRuvSQ

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Submenu with easy-menu-define yielding invalid menu item
  2022-10-19  2:49 ` Emanuel Berg
@ 2022-10-19 14:33   ` Heime
  0 siblings, 0 replies; 7+ messages in thread
From: Heime @ 2022-10-19 14:33 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

------- Original Message -------
On Wednesday, October 19th, 2022 at 2:49 AM, Emanuel Berg <incal@dataswamp.org> wrote:


> Heime via Users list for the GNU Emacs text editor wrote:
> 
> > I am making menus with "easy-menu-define". But I am having
> > difficulty calling the submenu "dingo-outline-subm"
> > from "easy-menu-define". Would appreciate some assistance
> > figuring out the problem.
> > 
> > The error captured is
> > 
> > Lisp error: (error "Invalid menu item in easymenu")
> 
> 
> Make a smaller menu that works and increase the size from
> there ...

The problem starts happening when I call a defvar as Jean has been
doing.  But a mix of defvar and ["Desc" myfunc t] seems to fail.



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

* Re: Submenu with easy-menu-define yielding invalid menu item
  2022-10-19 12:49   ` Emanuel Berg
@ 2022-10-19 20:23     ` Heime
  0 siblings, 0 replies; 7+ messages in thread
From: Heime @ 2022-10-19 20:23 UTC (permalink / raw)
  To: Stefan Monnier, Eli Zaretskii; +Cc: help-gnu-emacs, Emanuel Berg

------- Original Message -------
On Wednesday, October 19th, 2022 at 12:49 PM, Emanuel Berg <incal@dataswamp.org> wrote:

> Sharon Kimble wrote:
> 
> > ["call paradox - package manager" paradox-list-packages]
> 
> 
> Call it poison!
> 
> https://www.youtube.com/watch?v=xA6DtpRuvSQ
> 
> --
> underground experts united
> https://dataswamp.org/~incal

I wish people are sensible enough to understand who is being loathsome
when I ask questions here.  The more some call themselves "experts", the
worst their behaviour becomes.





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

* Re: Submenu with easy-menu-define yielding invalid menu item
  2022-10-19 11:51 ` Sharon Kimble
  2022-10-19 12:49   ` Emanuel Berg
@ 2022-10-19 21:04   ` Heime
  1 sibling, 0 replies; 7+ messages in thread
From: Heime @ 2022-10-19 21:04 UTC (permalink / raw)
  To: Sharon Kimble; +Cc: Heime via Users list for the GNU Emacs text editor


------- Original Message -------
On Wednesday, October 19th, 2022 at 11:51 AM, Sharon Kimble <boudiccas@skimble09.plus.com> wrote:


> Heime via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org writes:
> 
> > I am making menus with "easy-menu-define". But I am having difficulty calling the submenu "dingo-outline-subm"
> > from "easy-menu-define". Would appreciate some assistance figuring out the problem.
> > 
> > The error captured is
> > 
> > Lisp error: (error "Invalid menu item in easymenu")
> > 
> > ---------------------
> > 
> > ;; Make submenu outline
> > 
> > (defvar dingo-outline-subm
> > 
> > '("Outline"
> > 
> > ["Hide Direct Body" outline-hide-entry :help "Hide Entry"]
> > 
> > ["Expose Direct Body" outline-show-entry :help "Show Entry"]
> > 
> > ["Expose Headings" outline-hide-body :help "Hide Body"])
> > 
> > "Submenu giving outline capability.")
> > 
> > ;; Make top menu dingo
> > 
> > (defun dingo-easym ()
> > 
> > "Dingo easy menu."
> > 
> > (easy-menu-define dingo-menu global-map "Dingo"
> > 
> > '("Dingo"
> > 
> > dingo-outline-subm
> > 
> > ["Hide Entry" outline-hide-entry t]
> > 
> > ["Show Entry" outline-show-entry t]
> > 
> > ["Hide Body" outline-hide-body t])) )
> 
> 
> If it helps this is a very small part of my 'easy-menu'
> 
> =====
> (easy-menu-define sk-menu global-map "menu"
> '("Mono"
> ("Misc" ;; submenu
> ["Wrap Text" auto-fill-mode]
> ["Get colours" list-colors-display]
> ["Delete this file" delete-this-file]
> ["call paradox - package manager" paradox-list-packages]
> ["Show my cheatsheet" cheatsheet-show]
> ["typewriter-mode" centered-cursor-mode]
> ["Tea brewing time" tea-timer]
> ["Show current key-bindings" show-key-command]
> ["Set the font size" set-font-size]
> 
> )
> ))
> =====

Sharon, I can see you are using the [] construct to a list, which I can use
with defvar or defconst when the latter two construct a list.

Then the solution would be

["Outline" dingo-outline-subm t]

where one uses a defvar list rather than a callable function as done in

["Hide Entry" outline-hide-entry t]
 
> --
> A taste of linux = http://www.sharons.org.uk
> TGmeds = http://www.tgmeds.org.uk
> DrugFacts = https://www.drugfacts.org.uk
> Debian 11.5, fluxbox 1.3.7, emacs 29.0.50, org 9.5.5



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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-19  1:44 Submenu with easy-menu-define yielding invalid menu item Heime via Users list for the GNU Emacs text editor
2022-10-19  2:49 ` Emanuel Berg
2022-10-19 14:33   ` Heime
2022-10-19 11:51 ` Sharon Kimble
2022-10-19 12:49   ` Emanuel Berg
2022-10-19 20:23     ` Heime
2022-10-19 21:04   ` Heime

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).