all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Perry Wagle <wagle@mac.com>
To: XeCycle <xecycle@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: middle mouse paste into isearch minibuffer
Date: Tue, 25 Oct 2011 22:34:56 -0700	[thread overview]
Message-ID: <9B70B016-B17B-4134-BB85-9E52CB3CFA3B@mac.com> (raw)
In-Reply-To: <8739eg1g3b.fsf@gmail.com>

New comments, way at the bottom.

On Oct 25, 2011, at 10:23 PM, XeCycle wrote:

> Perry Wagle <wagle@mac.com> writes:
> 
> [...]
> 
>>> So you want to search the word at point, right?  Try C-s C-w.  If you
>>> need more, just press C-w more.
>> 
>> No, I have something in my mouse-2 paste buffer, one way or another.
> 
> Hmm, Emacs does have some problems with X primary selection.
> 
>> Also, I can double mouse-1 anywhere in a word.  Emacs wants me to be
>> more precise, by going to the beginning.
> 
> If you don't mind writing some Elisp, it's easy.  After all there's
> built-in M-h, you can refer to that.
> 
>> The mouse is not a precise instrument.  Rather, its a fast one, used
>> properly.
> 
> You're right, but how do you define "properly"?  I believe that's not my
> way of moving and clicking, it should be what I use it for.
> 
> [...]
> 
>>> I suggest throwing away your mouse.
>> 
>> I suggest learning to use your mouse effectively with a real GUI.
>> Then come back and make more refined suggestions.
> 
> I won't bother to learn more about mouse using, but here's the more
> refined suggestion:
> 
> In GNU Emacs, use keyboard more, mouse less.  As for me, I use mouse to
> drag the windows for resizing and moving, and when it's sometimes
> confused by the primary selection.  If you're very annoyed when dealing
> X primary selection, you can write some Elisp to insert the primary
> selection at point, perhaps with an external tool like `xsel'.
> 
>>> Some hints: Use isearch extensively.  Jump to somewhere with C-s (or
>>> C-r), and after you finished your edits there, jump back with C-u C-SPC
>>> --- you may press it more if it failed.
>> 
>> As I said above, the stuff gets into my mouse-2 paste buffer in a number of
>> ways.  I make no sense of the above.  It doesn't apply.
> 
> Sorry, I have the prejudice that one who uses mouse a lot will use mouse
> to move around in the buffer.  If you don't do that, please ignore
> these.
> 
>>>> Apparently, I'm going to have to do this myself, unless someone else
>>>> sees my light this time.  What's the best way to do it?  I have the
>>>> feeling I'm fighting the foundations of emacs to try to funnel mouse
>>>> button events into the minibuffer.
> 
> If you're interested in mouse in Emacs, you can help extending it.  In
> this case, you don't need to hack the core of Emacs yet.
> 
>>>> Thanks for whatever help, hints, and guidance you can give me!
>> 
>> With a little help from #emacs, I got isearch.el to do what I want, by
>> telling it to NOT abort itself if mouse-2 is pressed outside the
>> minibuffer.  But now it drags the highlighted region all over the
>> place when I keep pressing control s.
> 
> Don't know about this, since I don't know what you did exactly.

Here's my mods to isearch.el in emacs 23.2.1.  I commented out the lines
I didn't want and added the transient-mark-mode to *INCORRECTLY*
disable the highlighting (that is, I think I need to do it differently):

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

> 
> -- 
> Carl Lei (XeCycle)
> Department of Physics, Shanghai Jiao Tong University
> OpenPGP public key: 7795E591
> Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591




  reply	other threads:[~2011-10-26  5:34 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 [this message]
2011-11-10  4:09         ` Perry Wagle
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=9B70B016-B17B-4134-BB85-9E52CB3CFA3B@mac.com \
    --to=wagle@mac.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=xecycle@gmail.com \
    /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.