From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rajneesh Hegde Newsgroups: gmane.emacs.help Subject: customizing double click Date: Fri, 12 Aug 2005 20:11:32 -0400 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1123892760 20998 80.91.229.2 (13 Aug 2005 00:26:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 Aug 2005 00:26:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 13 02:25:59 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E3jpq-0000RF-L3 for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Aug 2005 02:25:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E3jt5-0003kN-4t for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Aug 2005 20:28:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E3jsL-0003Sg-Sk for help-gnu-emacs@gnu.org; Fri, 12 Aug 2005 20:27:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E3jsD-0003MV-L8 for help-gnu-emacs@gnu.org; Fri, 12 Aug 2005 20:27:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E3jsC-0003FB-Qx for help-gnu-emacs@gnu.org; Fri, 12 Aug 2005 20:27:40 -0400 Original-Received: from [64.233.184.201] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E3jrK-0003vT-Tw for help-gnu-emacs@gnu.org; Fri, 12 Aug 2005 20:26:47 -0400 Original-Received: by wproxy.gmail.com with SMTP id i23so841839wra for ; Fri, 12 Aug 2005 17:11:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ibmf+10CtkSAb+OquexisoY700n8S/nQ37CgaYhJpcJBGzfV3pSIcywiPp487WtN/TZyxfrpeLevnktsip02eAGryxgnFXDI4hxnlu0oVilOneoFwkpSheue9JKgC0HhwwKORXaQEAXBGq/0vKYwqJgwpaw/mgPFOF+phDKLIjQ= Original-Received: by 10.54.13.33 with SMTP id 33mr1730716wrm; Fri, 12 Aug 2005 17:11:32 -0700 (PDT) Original-Received: by 10.54.122.12 with HTTP; Fri, 12 Aug 2005 17:11:32 -0700 (PDT) Original-To: help-gnu-emacs@gnu.org Content-Disposition: inline X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:28693 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28693 hi, In LaTeX mode (AUCTeX), I want double-click to have the usual selection effect when the click is on a word-constituent character, but otherwise do a forward-search (i.e. invoke the dvi viewer). I wrote the following function for doing the latter: (defun my-LaTeX-forward-search (event) "Set point to the position of the mouse pointer and then call the function TeX-view from AucTeX." (interactive "e") (if (and (numberp (posn-point (event-start event))) =09 (looking-at "\\W")) (TeX-view))) Then I bind as follows: (define-key LaTeX-mode-map [double-down-mouse-1] 'my-LaTeX-forward-search) The problem is that on double-clicking on a word-constituent character, the double-down event runs the above function (which, as expected, does nothing) , but the subsequent double-click event doesn't have the usual effect of selecting the word. On the other hand, if I bind my function to [double-mouse-1], it doesn't even get invoked, although the binding is successful. What am I missing? Thanks, Rajneesh. P.S. I'm using GNU Emacs 22.0.50.2 (i386-mingw-nt5.1.2600) (from crasseux.com) on a WinXP Home machine (the mouse is a Synaptics touchpad.) The same problem happens with precompiled Emacs 21.3.