From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: isearch-query-replace-regexp and stuff Date: 06 Jul 2004 13:20:26 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: 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 1089113094 25418 80.91.224.253 (6 Jul 2004 11:24:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Jul 2004 11:24:54 +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 13:24:26 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 1Bho3l-0001W6-00 for ; Tue, 06 Jul 2004 13:24:25 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bho3l-00005I-00 for ; Tue, 06 Jul 2004 13:24:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bho5m-0006JV-5b for emacs-devel@quimby.gnus.org; Tue, 06 Jul 2004 07:26:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bho2y-0003fD-CQ for emacs-devel@gnu.org; Tue, 06 Jul 2004 07:23:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bho2w-0003do-JA for emacs-devel@gnu.org; Tue, 06 Jul 2004 07:23:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bho2w-0003dS-At for emacs-devel@gnu.org; Tue, 06 Jul 2004 07:23:34 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bho02-0006sL-ME for emacs-devel@gnu.org; Tue, 06 Jul 2004 07:20:34 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Bhnzv-00029N-FS; Tue, 06 Jul 2004 07:20:28 -0400 Original-To: Juri Linkov In-Reply-To: <877jth4e9u.fsf@mail.jurta.org> Original-Lines: 44 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:25480 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25480 Juri Linkov writes: > David Kastrup writes: > > It might be an idea to also bind C-M-% to the same, non-type-switching > > behavior for symmetry. If the user wants to switch behavior, he can > > do so with the existing M-r binding. > > 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. > > To make this more useful than just exiting search and restarting > > replacement, we might consider letting M-r in isearches keep the > > search string if it non-empty. This might be done in one of > > several ways: a) keep the search string unmodified. This has the > > advantage that you can keep already typed search string characters > > even when you accidentally started with the wrong search type. > > [...] After thinking this over, I think that maybe something like > > option "a)" would more often agree with what the user could expect > > and which would offer the most _additional_ usefulness. > > AFAIU, option "a)" is exactly the current behavior. That's what I get for not trying out things. > And I think no improvements are needed here. 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. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum