From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: set-temporary-overlay-map doesn't work for me Date: Wed, 27 Nov 2013 17:26:07 -0500 Message-ID: References: <87y549y1g6.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1385591256 22419 80.91.229.3 (27 Nov 2013 22:27:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Nov 2013 22:27:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 27 23:27:40 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vlna8-0007Pu-90 for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Nov 2013 23:27:40 +0100 Original-Received: from localhost ([::1]:38051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vlna7-000111-PV for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Nov 2013 17:27:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlnZ0-0008Pr-HN for help-gnu-emacs@gnu.org; Wed, 27 Nov 2013 17:26:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlnYt-000668-66 for help-gnu-emacs@gnu.org; Wed, 27 Nov 2013 17:26:30 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:35984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlnYs-00064V-Va for help-gnu-emacs@gnu.org; Wed, 27 Nov 2013 17:26:23 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VlnYr-0006e0-HH for help-gnu-emacs@gnu.org; Wed, 27 Nov 2013 23:26:21 +0100 Original-Received: from 206-248-161-33.dsl.teksavvy.com ([206.248.161.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Nov 2013 23:26:21 +0100 Original-Received: from monnier by 206-248-161-33.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Nov 2013 23:26:21 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 206-248-161-33.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:zua6xLLIPyf/pm4hPx0X1CDI4Lc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94685 Archived-At: > 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