From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: Need an enabler for a bad habit. Date: Thu, 02 Nov 2006 08:36:39 +0100 Message-ID: <4549A007.8070803@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1162453017 15438 80.91.229.2 (2 Nov 2006 07:36:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Nov 2006 07:36:57 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 02 08:36:56 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GfX84-0006Yn-Uc for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Nov 2006 08:36:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GfX84-00040p-4N for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Nov 2006 02:36:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GfX7p-0003t8-FR for help-gnu-emacs@gnu.org; Thu, 02 Nov 2006 02:36:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GfX7n-0003mf-PX for help-gnu-emacs@gnu.org; Thu, 02 Nov 2006 02:36:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GfX7n-0003mS-Kd for help-gnu-emacs@gnu.org; Thu, 02 Nov 2006 02:36:31 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1GfX7n-0002OD-F9 for help-gnu-emacs@gnu.org; Thu, 02 Nov 2006 02:36:31 -0500 Original-Received: (qmail invoked by alias); 02 Nov 2006 07:36:29 -0000 Original-Received: from N804P025.adsl.highway.telekom.at (EHLO [62.47.44.121]) [62.47.44.121] by mail.gmx.net (mp028) with SMTP; 02 Nov 2006 08:36:29 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: billlinux@rogers.com, help-gnu-emacs@gnu.org X-Y-GMX-Trusted: 0 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:38482 Archived-At: You probably want something like the below. Replace `execute-extended-command' by whatever you need. (defun mouse-drag-region (start-event) "Set the region to the text that the mouse is dragged over. Highlight the drag area as you move the mouse. This must be bound to a button-down mouse event. In Transient Mark mode, the highlighting remains as long as the mark remains active. Otherwise, it remains until the next input event. If the click is in the echo area, run a command." (interactive "e") (let ((w (posn-window (event-start start-event)))) (if (and (window-minibuffer-p w) (not (minibuffer-window-active-p w))) (save-excursion ;; Swallow the up-event. (read-event) (call-interactively 'execute-extended-command)) ;; Give temporary modes such as isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) (mouse-drag-track start-event t))))