From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: set-temporary-overlay-map doesn't work for me
Date: Wed, 27 Nov 2013 17:26:07 -0500 [thread overview]
Message-ID: <jwveh61jxdg.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: 87y549y1g6.fsf@gmail.com
> I have two quite simple functions:
> (defun my-temp ()
> (interactive)
> (set-temporary-overlay-map
> (let ((map (make-sparse-keymap)))
> (define-key map [mouse-1] 'my-mouse-down)
> map)))
> (defun my-mouse-down ()
> (interactive)
> (message "Word is: %s " (thing-at-point 'word)))
> I evaluate them, then M-x my-temp RET, then mouse click (left button) on
> "interactive" world and I'm expecting to see "Word is "interactive""
> message in the minibuffer. But no messages appear! I cannot figure out
> why this code behaves in such way...
I think the problem is that clicking with your mouse will do two things:
`down-mouse-1' then `mouse-1' and the first will exit the temporary
overlay map.
Stefan
prev parent reply other threads:[~2013-11-27 22:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 21:37 set-temporary-overlay-map doesn't work for me Andrey Tykhonov
2013-11-27 22:00 ` Drew Adams
2013-11-27 22:40 ` Andrey Tykhonov
2013-11-27 22:48 ` Drew Adams
2013-11-27 22:26 ` Stefan Monnier [this message]
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=jwveh61jxdg.fsf-monnier+gmane.emacs.help@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=help-gnu-emacs@gnu.org \
/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).