unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: martin rudalics <rudalics@gmx.at>
Subject: Re: Need an enabler for a bad habit.
Date: Thu, 02 Nov 2006 08:36:39 +0100	[thread overview]
Message-ID: <4549A007.8070803@gmx.at> (raw)

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))))

             reply	other threads:[~2006-11-02  7:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-02  7:36 martin rudalics [this message]
     [not found] <mailman.67.1162475959.2155.help-gnu-emacs@gnu.org>
2006-11-02 14:23 ` Need an enabler for a bad habit Mathias Dahl
2006-11-02 16:31   ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2006-11-02 14:00 martin rudalics
     [not found] <mailman.51.1162452995.2155.help-gnu-emacs@gnu.org>
2006-11-02  9:42 ` Mathias Dahl
     [not found] <mailman.472.1162314011.27805.help-gnu-emacs@gnu.org>
2006-10-31 17:34 ` Pascal Bourguignon
2006-11-01  9:33   ` Mathias Dahl
2006-11-01 11:25     ` William Case
     [not found]     ` <mailman.12.1162380544.2155.help-gnu-emacs@gnu.org>
2006-11-01 15:05       ` Mathias Dahl
2006-11-01 16:38         ` William Case
2006-11-01 17:55           ` Peter Dyballa
2006-11-01 20:17           ` Kevin Rodgers
2006-11-01 23:12             ` William Case
2006-11-02 18:54               ` Kevin Rodgers
2006-11-01 23:28             ` William Case
     [not found]         ` <mailman.19.1162399165.2155.help-gnu-emacs@gnu.org>
2006-11-01 16:45           ` David Kastrup
2006-11-01 17:03           ` Mathias Dahl
2006-11-03 17:59             ` Drew Adams
2006-10-31 16:59 William Case
2006-11-03 19:30 ` William Case

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4549A007.8070803@gmx.at \
    --to=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).