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

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

RE: [External] : menu-item uses no dot period before item-property-list


From: Drew Adams
Subject: RE: [External] : menu-item uses no dot period before item-property-list in examples
Date: Mon, 17 Jul 2023 16:36:37 +0000

> > > So why bother users in the manual why that is never actually used.
> > > (menu-item item-name real-binding item-property-list)
> >
> > I hope you meant this, which is not the same thing:
> > (menu-item item-name real-binding
> > . item-property-list)
> >
> > item-property-list is not an element of the
> > overall list. It's "spliced" into that list,
> > as its tail.
>
> Actual code implementations using menu-item does not include
> '.' before 'item-property-list'.
> (menu-item item-name real-binding . item-property-list)

Look again.  item-property-list must be a list.
That list is _not_ included as an element in
the list that starts (menu-item....

Instead, the _elements_ of item-property-list
are included as elements of list (menu-item....
That's apparently what you're not getting.

Example:

'(menu-item "Load" diredp-load-this-file
  :help "Load this Elisp file")

item-name           is  "Load".
real-binding        is  diredp-load-this-file
item-property-list  is
  this 2-element list: (:help
                        "Load this Elisp file")

You do _not_ see this:

'(menu-item "Load" diredp-load-this-file
  (:help "Load this Emacs Lisp file"))
  ^                                 ^

which is equal to this:

'(menu-item "Load" diredp-load-this-file
  . ((:help "Load this Emacs Lisp file")))
  ^ ^                                   ^

What you do see is equal to this:

'(menu-item "Load" diredp-load-this-file
  . (:help "Load this Emacs Lisp file"))

Now ask yourself _why_ the syntax spec
shows a dot before item-property-list.

If you still don't get it, take a break,
stand on your head for a few minutes, run
around the block, then study this again...
till you do.

When you finally get it, go look at the
Emacs documentation that introduces lists
and their notation.  You'll find it very
clear, I think.  All of this is explained.

And yes, you should read the basics, such
as notation, _before_ you start trying to
interpret the _use_ of such notation in the
doc.  E.g., before you try to interpret the
presentation of the syntax of extended menu
items, learn about Lisp dot notation.

And as has also been said, this isn't just
a doc notational convention.  It's in fact
the actual, effective, real-life Lisp list
syntax.

Crawl, then walk, before trying to run.
That way, you'll find that running isn't
so difficult, mysterious, confusing, scary,
or user-unfriendly.

And that way maybe you'll stop kvetching
that you're "drowning" and that folks need
to quickly line up and start saving you.

Don't presume that those trying to help you
don't get it.  You're not the first person
to learn Lisp, and you're not the first one
that people here, and Emacs itself, has
helped.

And maybe read this - it might be humbling.

https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

Attachment: baby-bird.jpg
Description: baby-bird.jpg

Attachment: help-help-drowning.jpg
Description: help-help-drowning.jpg


reply via email to

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