[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set-temporary-overlay-map doesn't work for me
From: |
Stefan Monnier |
Subject: |
Re: set-temporary-overlay-map doesn't work for me |
Date: |
Wed, 27 Nov 2013 17:26:07 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> 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