[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need an enabler for a bad habit.
From: |
Mathias Dahl |
Subject: |
Re: Need an enabler for a bad habit. |
Date: |
Thu, 02 Nov 2006 10:42:05 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
martin rudalics <rudalics@gmx.at> 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.
- Re: Need an enabler for a bad habit., (continued)
- Re: Need an enabler for a bad habit., William Case, 2006/11/01
- Re: Need an enabler for a bad habit., Peter Dyballa, 2006/11/01
- Re: Need an enabler for a bad habit., Kevin Rodgers, 2006/11/01
- Re: Need an enabler for a bad habit., William Case, 2006/11/01
- Re: Need an enabler for a bad habit., Kevin Rodgers, 2006/11/02
- Re: Need an enabler for a bad habit., William Case, 2006/11/01
- Message not available
- Re: Need an enabler for a bad habit., David Kastrup, 2006/11/01
- Message not available
- Re: Need an enabler for a bad habit., Mathias Dahl, 2006/11/01
- RE: Need an enabler for a bad habit., Drew Adams, 2006/11/03
Re: Need an enabler for a bad habit., martin rudalics, 2006/11/02
Re: Need an enabler for a bad habit.,
Mathias Dahl <=
Re: Need an enabler for a bad habit., martin rudalics, 2006/11/02
Re: Need an enabler for a bad habit., Mathias Dahl, 2006/11/02
Re: Need an enabler for a bad habit., William Case, 2006/11/03