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: 08 Jul 2004 20:12:14 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <877jth4e9u.fsf@mail.jurta.org> <87zn6dqei0.fsf@mail.jurta.org> <87eknoifmv.fsf@mail.jurta.org> <87vfgz4qn3.fsf@mail.jurta.org> <87oemqs8f2.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 1089310372 19498 80.91.224.253 (8 Jul 2004 18:12:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Jul 2004 18:12:52 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Jul 08 20:12:35 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 1BidNq-0006h1-00 for ; Thu, 08 Jul 2004 20:12:34 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BidNq-0006Lp-00 for ; Thu, 08 Jul 2004 20:12:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BidPy-0006X9-C0 for emacs-devel@quimby.gnus.org; Thu, 08 Jul 2004 14:14:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BidPq-0006Wq-C7 for emacs-devel@gnu.org; Thu, 08 Jul 2004 14:14:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BidPp-0006WY-J7 for emacs-devel@gnu.org; Thu, 08 Jul 2004 14:14:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BidPp-0006WV-GE for emacs-devel@gnu.org; Thu, 08 Jul 2004 14:14:37 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BidNf-0005mp-MT for emacs-devel@gnu.org; Thu, 08 Jul 2004 14:12:23 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1BidNY-00081g-AQ; Thu, 08 Jul 2004 14:12:17 -0400 Original-To: Juri Linkov In-Reply-To: <87oemqs8f2.fsf@mail.jurta.org> Original-Lines: 67 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:25545 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25545 Juri Linkov writes: > David Kastrup writes: > > > > Because of some internal comment? > > There is no other source of information about the current > implementation, but this comment explicitly states the intention of > introducing those keybindings. A code comment is completely irrelevant for deciding about the best way to do something unless you happen to consider the writer of the comment a superior being whose intent you need to cast upon the user. Things are slightly different with regard to actual user-accessible documentation: there the user might have been exposed to it already if it has persisted for some time. > The current behavior is a consequence of a simpler implementation > that ignores the case of using C-M-s in normal searches as > unimportant. It is unimportant. > >> And there is no symmetry between normal and regexp searches > > > > Not? Considering that both behave the same with regard to C-s and > > C-M-s I would think there was. And intentionally so. > > According to comments in isearch.el (supposedly written by authors > of the current implementation) it is not intentional. I can't see any comment that would state a different intention. > Anyway, I don't want to make C-M-% consistent with accidental > features, but what I want is to make it more convenient. Invoking > `query-replace-regexp' makes sense even in a non-regexp search for > the sake of using features available only in regexp replacements > (like using \# and \,), for example: > > C-s foo C-M-% \&<\#> RET C-s foo M-r C-% \&<\#> RET Hardly more complicated. The problem is that switching from regexp searches to non-regexp searches buys us problems with the validity of the search string. With M-r, we have _one_ point to deal with them, M-r itself. And we are just now discussing how to turn this into something visible and coherent. If we add an implicit and unsymmetric one-way to switch to regexp-matching as well as replacement, we don't have the opportunity to announce to the user that a switch has happened and is causing a difference. And how would you want to write this in the manual? "You can use either M-% or C-M-% in a regexp isearch to do a regexp replacement, but only M-% will do a plain replacement in normal isearch whereas C-M-% will switch to a regexp replacement, while the current match will not [or maybe will?] get quotified so the match does not stop for future replacements". That's a bunch of crock. It is not worth the price in obscurity, just to save the user from pressing one additional key. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum