On Dec 30, 2010, at 1:39 AM, Tassilo Horn wrote: > Perry Wagle writes: > > Hi Perry, > >> In xemacs, if I double click on a word, the word is highlighted. If I >> then press control-s for search, and click the middle mouse button >> *without moving the mouse*, I will paste that word into the search >> string, and all is good. >> >> Emacs, on the other hand, does not support this idiom. For some >> reason, the middle mouse button *ABORTS* the search mode, and then >> pastes the word under the mouse. Why would you want that? > > Hm, middle mouse button is "paste the primary selection at this > position" in almost any X application. The position is the search function waiting for a string to look for. >> This idiom alone has kept me using xemacs for over a decade. I'd like >> to switch to emacs now. >> >> Can I fix this easily with option-setting, or does it require me to >> hack and add the correct behavior? > > Simply add a keybinding for that: > > --8<---------------cut here---------------start------------->8--- > (define-key isearch-mode-map (kbd "") > 'isearch-yank-x-selection) > --8<---------------cut here---------------end--------------->8--- > > If you don't like how that expands the region (including highlighting), > then use something like that to deactivate the mark before: > > --8<---------------cut here---------------start------------->8--- > (define-key isearch-mode-map (kbd "") > (lambda () > (interactive) > (deactivate-mark) > (isearch-yank-x-selection))) > --8<---------------cut here---------------end--------------->8--- > WIll try this, thanks! -- Perry