From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: popup menu code
Date: Thu, 23 Oct 2003 22:01:48 GMT [thread overview]
Message-ID: <jwvd6cnvcod.fsf-monnier+gnu.emacs.help@vor.iro.umontreal.ca> (raw)
In-Reply-To: MQWlb.30142$pT1.15751@twister.nyc.rr.com
> (define-key menu [kill-region]
> (cons "Cut"
> '(when (and mark-active (not buffer-read-only)
> (call-interactively 'kill-region)))))
Does this work? I know it does in easy-menus, but I don't think it does
in your case. But even if it does, it's a bad idea.
Better use an `activate' property. Check out the elisp documentation.
More specifically, look for `menu-item' in the index.
> (defun right-popup () ;event
> "Run the command selected from `right-popup-menu'."
> (interactive)
> (call-interactively (or (car (x-popup-menu t right-popup-menu))
> 'ignore)))
> (global-set-key [mouse-3] 'right-popup)
IIRC, you can get rid of right-popup and just do
(global-set-key [mouse-3] right-popup-menu)
-- Stefan
next prev parent reply other threads:[~2003-10-23 22:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-23 20:27 popup menu code Bruce Ingalls
2003-10-23 22:01 ` Stefan Monnier [this message]
2003-10-24 17:10 ` Bruce Ingalls
2003-10-24 17:32 ` Stefan Monnier
2003-10-23 22:14 ` Stefan Monnier
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=jwvd6cnvcod.fsf-monnier+gnu.emacs.help@vor.iro.umontreal.ca \
--to=monnier@iro.umontreal.ca \
/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).