From: Yuri Khan <yurivkhan@gmail.com>
To: nljlistbox2@gmail.com
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Pop up context menu (at point) with <menu> key rather than mouse
Date: Sun, 11 Nov 2018 00:27:17 +0700 [thread overview]
Message-ID: <CAP_d_8WOPawTOPG9n4ybqrZ779KpFk9XV7qRVe3m3fs4-6u4JA@mail.gmail.com> (raw)
In-Reply-To: <87bm6wluxf.fsf@moondust.localdomain>
On Sun, Nov 11, 2018 at 12:11 AM N. Jackson <nljlistbox2@gmail.com> wrote:
> > (global-set-key [C-down-mouse-3]
> > `(menu-item ,(purecopy "Menu Bar") ignore
> > :filter (lambda (_)
> > (if (zerop (or (frame-parameter nil 'menu-bar-lines) 0))
> > (mouse-menu-bar-map)
> > (mouse-menu-major-mode-map)))))
>
> Hmm... where is `menu-item' defined?
See the ‘`’ character? That indicates that the following is a quoted
list (except that the part prefixed with ‘,’ is not quoted. Anyway,
that is a list whose first element is the symbol 'menu-item, and that
list is passed to ‘global-set-key’.
So you want to go look what ‘global-set-key’ does with that. You might
know, or learn from the source, that ‘global-set-key’ is a wrapper
function around ‘define-key’. Then, C-h f define-key tells you its
last argument can take a number of forms, none of which seem to match
a list '(menu-item …), except possibly this:
DEF is anything that can be a key’s definition:
[…]
or an extended menu item definition.
(See info node ‘(elisp)Extended Menu Items’.)
So you dive into that info node, and sure enough, it explains that an
extended menu item is a list starting with 'menu-item.
next prev parent reply other threads:[~2018-11-10 17:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-09 19:19 Pop up context menu (at point) with <menu> key rather than mouse N. Jackson
2018-11-09 19:29 ` Eli Zaretskii
2018-11-10 17:11 ` N. Jackson
2018-11-10 17:27 ` Yuri Khan [this message]
2018-11-10 17:50 ` N. Jackson
2018-11-10 18:00 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAP_d_8WOPawTOPG9n4ybqrZ779KpFk9XV7qRVe3m3fs4-6u4JA@mail.gmail.com \
--to=yurivkhan@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=nljlistbox2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).