all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Perry Wagle <wagle@mac.com>
To: help-gnu-emacs@gnu.org
Subject: Re: middle mouse paste into isearch minibuffer
Date: Wed, 09 Nov 2011 20:09:32 -0800	[thread overview]
Message-ID: <45A1589E-53D1-47AA-B13E-8B0870435586@mac.com> (raw)
In-Reply-To: <9B70B016-B17B-4134-BB85-9E52CB3CFA3B@mac.com>

Hi Again --

I'm trying to use the mouse to paste to the isearch prompt.

The following mod lets me highlight some text with my mouse (or
otherwise have it in my kill buffer), then press control-s with my
left hand, then middle mouse with my right hand to paste the
kill-buffer (?) into the mini-buffer where isearch is waiting for a
string to search for.  

This is without the tedium of carefully moving the mouse way down to
the mini-buffer where I don't even want to look, much less navigate
the mouse to.  My peripheral vision is good enough to see that
something is happening down there, which is all the information I
need.


It's got a problem that I need advice on:

(defun isearch-mouse-2 (click)
 "Handle mouse-2 in Isearch mode.
For a click in the echo area, invoke `isearch-yank-x-selection'.
Otherwise invoke whatever the calling mouse-2 command sequence
is bound to outside of Isearch."
 (interactive "e")
;;  (let* ((w (posn-window (event-start click)))
;;	 (overriding-terminal-local-map nil)
;;	 (binding (key-binding (this-command-keys-vector) t)))
;;    (if (and (window-minibuffer-p w)
;;	     (not (minibuffer-window-active-p w))) ; in echo area
	(isearch-yank-x-selection)
	(transient-mark-mode)
;;      (when (functionp binding)
;;	  (call-interactively binding)))))
)

The problem is with the call to transient-mark-mode.  Its my first
attempt to fix what I think is a runaway mark-region.

If I don't have it, then varying regions of text become highlighted
when I move around with repeated pressings of control-s.

If I do have it, then I get the other extreme of closing down
transient mark mode entirely.

The advice I need is this: I think this should work similarly to how
keyboard bound people use it.  I think that there is some intention
that control-s SHOULD move the highlighted region around.  But if I
double click on or otherwise highlight a region so it can be pasted to
isearch mini-buffer, that SHOULDN'T set the mark (I think) for
afterwards, when you are control-s'ing around.

Is this right?  What do I want to do to be consistent with the rest of
emacs?  How do I do "the right thing"?  Do I start using the mark-ring
or something?

In short, I don't know what all behavior I need to preserve to do this
correctly.

Thanks!

-- Perry


PS.  If you hate your mouse, please refrain from saying how to do this
without the mouse.  Its been done, to excess, thanks.  The question is
"how to integrate the mouse cleanly and consistently in a small way
into emacs?".




  reply	other threads:[~2011-11-10  4:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25  5:38 middle mouse paste into isearch minibuffer Perry Wagle
2011-10-25 10:33 ` XeCycle
2011-10-26  4:36   ` Perry Wagle
2011-10-26  5:23     ` XeCycle
2011-10-26  5:34       ` Perry Wagle
2011-11-10  4:09         ` Perry Wagle [this message]
2011-11-10 20:53           ` Drew Adams
2011-11-10 21:21             ` Perry Wagle
2011-11-11 14:12             ` Harry Putnam
2011-11-11 14:40               ` Drew Adams
2011-11-11 15:28                 ` Harry Putnam
2011-11-11 15:36                   ` Harry Putnam
2011-11-11 15:34                 ` Harry Putnam
2011-11-11 15:48                   ` Drew Adams
2011-11-12  1:22                 ` Drew Adams
     [not found] <mailman.1010.1319521101.15868.help-gnu-emacs@gnu.org>
2011-10-25 13:52 ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=45A1589E-53D1-47AA-B13E-8B0870435586@mac.com \
    --to=wagle@mac.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.