From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: word search (Re: isearch in Dired) Date: Thu, 31 Jul 2008 10:10:48 -0400 Message-ID: References: <874pjaiv45.fsf@gmail.com> <87lkclekep.fsf@jurta.org> <87r69k2vcw.fsf_-_@jurta.org> <87abg6ajlr.fsf@jurta.org> <48892105.7000504@gmail.com> <87abg0ohx6.fsf_-_@jurta.org> <87zlo0oba0.fsf@stupidchicken.com> <87myjz8ggy.fsf@jurta.org> <878wvicjtk.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1217513484 24597 80.91.229.12 (31 Jul 2008 14:11:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jul 2008 14:11:24 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 31 16:12:13 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KOYsv-0004Q6-FF for ged-emacs-devel@m.gmane.org; Thu, 31 Jul 2008 16:12:05 +0200 Original-Received: from localhost ([127.0.0.1]:35443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOYrw-0006aH-0J for ged-emacs-devel@m.gmane.org; Thu, 31 Jul 2008 10:11:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOYrr-0006a3-Lm for emacs-devel@gnu.org; Thu, 31 Jul 2008 10:10:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOYrp-0006ZD-Df for emacs-devel@gnu.org; Thu, 31 Jul 2008 10:10:58 -0400 Original-Received: from [199.232.76.173] (port=39608 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOYrp-0006ZA-BH for emacs-devel@gnu.org; Thu, 31 Jul 2008 10:10:57 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:47284) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KOYro-00050v-S7 for emacs-devel@gnu.org; Thu, 31 Jul 2008 10:10:57 -0400 Original-Received: from alfajor.home (vpn-132-204-232-29.acd.umontreal.ca [132.204.232.29]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id m6VEAqSR028822; Thu, 31 Jul 2008 10:10:53 -0400 Original-Received: by alfajor.home (Postfix, from userid 20848) id 697DD1C16A; Thu, 31 Jul 2008 10:10:49 -0400 (EDT) In-Reply-To: <878wvicjtk.fsf@jurta.org> (Juri Linkov's message of "Thu, 31 Jul 2008 15:35:59 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3071=0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:101795 Archived-At: > Actually incremental word search is useless. While typing a sequence of > words, incremental word search advances forward through false positives > and failures because it tries to match on all incomplete word boundaries. > When the user finishes typing a complete sequence of words, the current > match may skip some matches from the starting point. So this behavior > makes more harm! I'm not sure what you mean by "this behavior". If you mean the behavior of M-s w, then it's no worse than what we had before, right? And it does allow circumventing this problem in some cases if you use "C-s M-s w". The right behavior for word search would be to only add a "word boundary" at the end of the pattern when the user is done entering the pattern. Since isearch has no such notion of "done entering the pattern", getting things right requires extra changes. Your suggestion to just revert to a non-incremental search might be a good one. But I think it gives up a bit too early. We should first try harder to make incremental word search work. E.g. we could provide a key that says "here, I'm done entering the pattern". That key could be C-s/C-r or RET, or something else. Entering more text should probably revert back to "the pattern is not done yet". Thinking a bit more about it, there's already a key that will do just that: SPC. So I suggest we change isearch to not use word-search-forward but use its own implementation of it that only adds a trailing \b if the last char of the pattern is a word constituent. It should give us the right behavior. > So I propose to display a warning after typing C-w in the isearch-edit-string > minibuffer that this feature is obsolete and suggest using `M-s w' instead > for the upcoming release. After this release, we can eliminate it completely > or replace with word-yanking. Fine by me. > This feature is useful for regexp Isearch as well because often it is > distracting to see warnings "incomplete input" while typing a complex > regexp in Isearch mode. I completely disagree. I always use C-u C-s ... M-% to do regexp search&replace specifically because it's so much more convenient to be able to enter the regexp incrementally. If you're bothered by the "incomplete input" warning, we should try and address that directly. Stefan