From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.help Subject: Re: isearch and yank word doubt Date: Fri, 31 May 2013 12:38:35 +0200 Organization: Sebastien Vauban Message-ID: <86bo7r5t90.fsf@somewhere.org> References: <86k3mf61v1.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1370013938 13040 80.91.229.3 (31 May 2013 15:25:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 May 2013 15:25:38 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Fri May 31 17:25:39 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 1UiRCz-0002j2-Mg for geh-help-gnu-emacs@m.gmane.org; Fri, 31 May 2013 17:25:37 +0200 Original-Received: from localhost ([::1]:55062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiRCz-0000eN-AX for geh-help-gnu-emacs@m.gmane.org; Fri, 31 May 2013 11:25:37 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Injection-Info: mx05.eternal-september.org; posting-host="56267169612f95d5ad2eeba965a549c1"; logging-data="11233"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX1/idGzBuU6fRZLb1VOhTCxu" User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:wcx9pYwGsEoxAb+ypEgtiAH/9Wo= sha1:1QlpaAO3tsHNgg09GJZqAgkCL14= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:198935 X-Mailman-Approved-At: Fri, 31 May 2013 11:25:25 -0400 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.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-mXXj517/zsQ@public.gmane.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:91202 Archived-At: Kevin Rodgers wrote: > 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's it: in many cases, you don't see anymore the original word you were on. And you don't know if you needed to press another time on C-w, if word stopped at `-' and you want to add the rest, for example. > 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)... So, IIUC, you would not move point (OK, I see no reason why it absolutely should), and stay on the "reference" search string, that's it? Thanks anyway... Best regards, Seb -- Sebastien Vauban