From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: isearch and yank word doubt Date: Fri, 31 May 2013 02:30:12 -0600 Message-ID: References: <86k3mf61v1.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1369988992 31979 80.91.229.3 (31 May 2013 08:29:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 May 2013 08:29:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 31 10:29:51 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UiKid-00025u-6F for geh-help-gnu-emacs@m.gmane.org; Fri, 31 May 2013 10:29:51 +0200 Original-Received: from localhost ([::1]:51363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiKic-000493-Mx for geh-help-gnu-emacs@m.gmane.org; Fri, 31 May 2013 04:29:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiKiJ-00044T-WB for help-gnu-emacs@gnu.org; Fri, 31 May 2013 04:29:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UiKiH-0007YJ-Bx for help-gnu-emacs@gnu.org; Fri, 31 May 2013 04:29:31 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiKiH-0007YA-5Z for help-gnu-emacs@gnu.org; Fri, 31 May 2013 04:29:29 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UiKiE-0001rd-6W for help-gnu-emacs@gnu.org; Fri, 31 May 2013 10:29:26 +0200 Original-Received: from 70-59-7-113.hlrn.qwest.net ([70.59.7.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 31 May 2013 10:29:26 +0200 Original-Received: from kevin.d.rodgers by 70-59-7-113.hlrn.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 31 May 2013 10:29:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 70-59-7-113.hlrn.qwest.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 In-Reply-To: <86k3mf61v1.fsf@somewhere.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91200 Archived-At: On 5/31/13 1:32 AM, Sebastien Vauban wrote: > Kevin Rodgers wrote: >> On 5/30/13 12:42 AM, Luca Ferrari wrote: >>> Hi all, >>> according to the manual the C-s C-w yanks the next word the cursor is >>> on as the string to search with isearch. Often I found myself having >>> the cursor in the middle of a word, so I have to go back to the >>> beginning and then do the yank, is there a better way to instrument >>> C-s C-w to get the word the cursor is in? >> >> I like it! ... > One detail I don't like in the above: when C-s C-w'ing, it directly jumps to > the next occurrence of the searched string. I find it'd be better if it'd stay > on the current word, highlighting it completely. That may be very difficult to implement, and it doesn't make sense to me: isearch by definition searches the buffer from point to the end, so if the search string includes text preceding point it cannot match the occurrence that straddles point. Of course, the occurrence that straddles point is eventually matched if the search is wrapped past the end of the buffer. And even before wrapping, the occurrence is highlighted with the lazy-highlight face -- although it may no longer be visible, depending on how far away is the next occurrence. That highlighting does seem intuitive, so I'll try to come up with a clean implementation of the behavior you want (that does not actually move point out of the middle of the word)... -- Kevin Rodgers Denver, Colorado, USA