help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

set-temporary-overlay-map doesn't work for me


From: Andrey Tykhonov
Subject: set-temporary-overlay-map doesn't work for me
Date: Wed, 27 Nov 2013 23:37:07 +0200
User-agent: mu4e 0.9.9; emacs 24.3.1


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]