unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* set-temporary-overlay-map doesn't work for me
@ 2013-11-27 21:37 Andrey Tykhonov
  2013-11-27 22:00 ` Drew Adams
  2013-11-27 22:26 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Andrey Tykhonov @ 2013-11-27 21:37 UTC (permalink / raw)
  To: help-gnu-emacs



Hi all,

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...

By the way I have tried (global-set-key [mouse-1] 'my-mouse-down) and
this works and I see the message. Also I've tried:

(define-key map (kbd "C-c C-c") 'my-mouse-down) and this code also works well.

But I need mouse click to be processed and to be processed only once!

What trouble with these two functions?

P.S.: Values of `overriding-terminal-local-map` and `overriding-local-map`
variables are nil.


Best regards,
Andrey



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-27 22:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).