From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Need an enabler for a bad habit. Date: Thu, 02 Nov 2006 10:42:05 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1162460658 5018 80.91.229.2 (2 Nov 2006 09:44:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Nov 2006 09:44:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 02 10:44:17 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 1GfZ7J-0002wn-BP for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Nov 2006 10:44:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GfZ7I-0004W7-N7 for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Nov 2006 04:44:08 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-X-Trace: individual.net RGxy4UDHr9XNlbGLI+2GHgE8BK7imjJPKy8HXaSG5Hgzhj5RBi User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:tt/d92U8U5EpCVdDKzzKjV2NX2U= Original-Xref: shelby.stanford.edu gnu.emacs.help:142868 Original-To: help-gnu-emacs@gnu.org 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:38487 Archived-At: martin rudalics writes: > 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)))) Hey, that's actually quite neat! The only drawback I can see with it is that it removes the "pop up the message buffer" function.