From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: isearch-query-replace-regexp and stuff Date: Tue, 06 Jul 2004 19:36:38 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87zn6dqei0.fsf@mail.jurta.org> References: <877jth4e9u.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1089133088 21346 80.91.224.253 (6 Jul 2004 16:58:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Jul 2004 16:58:08 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jul 06 18:57:57 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BhtGW-0000Y2-00 for ; Tue, 06 Jul 2004 18:57:56 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BhtGW-0005os-00 for ; Tue, 06 Jul 2004 18:57:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BhtIW-0004Lx-BD for emacs-devel@quimby.gnus.org; Tue, 06 Jul 2004 13:00:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BhtIH-0004Ht-12 for emacs-devel@gnu.org; Tue, 06 Jul 2004 12:59:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BhtIF-0004HO-GY for emacs-devel@gnu.org; Tue, 06 Jul 2004 12:59:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BhtIF-0004HK-5q for emacs-devel@gnu.org; Tue, 06 Jul 2004 12:59:43 -0400 Original-Received: from [66.33.219.19] (helo=spoon.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BhtFn-0001ko-IL; Tue, 06 Jul 2004 12:57:11 -0400 Original-Received: from mail.jurta.org (80-235-32-73-dsl.mus.estpak.ee [80.235.32.73]) by spoon.dreamhost.com (Postfix) with ESMTP id D898813DE03; Tue, 6 Jul 2004 09:56:19 -0700 (PDT) Original-To: David Kastrup In-Reply-To: (David Kastrup's message of "06 Jul 2004 13:20:26 +0200") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) 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: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25494 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25494 David Kastrup writes: > Juri Linkov writes: >> C-M-% is a standard key binding to start regexp replacement, >> so it should be available in isearch too. > > Well, C-s is a standard key binding to start literal searches, so the > same argument would apply for its meaning of continuing a regexp > search. This analogy is appropriate (even C-M-s can continue a non-regexp search), but at the same time I think no one would have an incentive to type C-M-% in a non-regexp search to start a non-regexp replacement. C-M-% is quite hard to type, and if someone still decided to type it, this means only that it was typed with the intention to start a regexp replacement. > Well, if I do > C-s e[e] M-r > on this mail, then a "failed isearch" turns into a "failed regexp > isearch" until I press C-s again. While this has the advantage that > M-r M-r is a noop, it seems counterintuitive. Maybe switching with > M-r should do something like the following? > > If looking-at (or its non-regexp equivalent) returns non-nil after the > change, remove a potentially previous "failed" tag. If looking-at > returns nil, call the search "pending" instead of "failed" until C-s > is pressed again. Maybe it's better to always clear the failed flag after switching with M-r, because repeating the failed search after switching the search type has such undesirable behavior as wrapping the search and starting from the beginning of the buffer. After switching the search type it should continue from the same point even if the previous search type failed. -- Juri Linkov http://www.jurta.org/emacs/