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: query-replace-interactive not documented Date: Wed, 16 Jun 2004 11:08:43 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87wu27exh0.fsf@mail.jurta.org> References: <20040528.181649.25475113.wl@gnu.org> <200405291737.i4THbPJ06689@raven.dms.auburn.edu> <873c5jug73.fsf@mail.jurta.org> <87oenqa4lu.fsf@mail.jurta.org> <873c51w5rq.fsf@mail.jurta.org> <87659snbd8.fsf@mail.jurta.org> <878yeoadpd.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 1087376956 4789 80.91.224.253 (16 Jun 2004 09:09:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 Jun 2004 09:09:16 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jun 16 11:09:05 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 1BaWPo-0007fG-00 for ; Wed, 16 Jun 2004 11:09:04 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BaWPo-0007nh-00 for ; Wed, 16 Jun 2004 11:09:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BaWQn-0004BU-Hb for emacs-devel@quimby.gnus.org; Wed, 16 Jun 2004 05:10:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BaWQa-0004B1-M2 for emacs-devel@gnu.org; Wed, 16 Jun 2004 05:09:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BaWQY-0004AK-Lx for emacs-devel@gnu.org; Wed, 16 Jun 2004 05:09:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BaWQY-00049z-6Z for emacs-devel@gnu.org; Wed, 16 Jun 2004 05:09:50 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BaWPH-0000qR-DF; Wed, 16 Jun 2004 05:08:31 -0400 Original-Received: from [66.33.205.9] (helo=spatula.dreamhost.com) by mx20.gnu.org with esmtp (Exim 4.34) id 1BaVbB-0004AA-W2; Wed, 16 Jun 2004 04:16:50 -0400 Original-Received: from mail.jurta.org (80-235-33-203-dsl.mus.estpak.ee [80.235.33.203]) by spatula.dreamhost.com (Postfix) with ESMTP id EEB8217D021; Wed, 16 Jun 2004 01:11:52 -0700 (PDT) Original-To: David Kastrup In-Reply-To: (David Kastrup's message of "16 Jun 2004 03:16: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.4 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:25026 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25026 David Kastrup writes: >> Another option may be >> \`read-expression optionally followed by ' which gives us >> >> \\footnote{\\label{fn:\`replace-count'}} >> >> as well as >> >> \\footnote{\\label{fn:\`(or replace-count)}} >> >> \` has somewhat more of a "will be evaluated later" scent and it has >> the advantage that it is somewhat natural to match it up with ' in >> case we need to explicitly end the read expression. Perhaps \` is a better symbol than \', but having a special meaning of ' following the expression seems wrong. This is an additional rule that the user should learn, and it may produce undesirable results when users forget this rule and put ' with the intention to use it in the replacement. > Ok, here is the whole ugly thing: it certainly won't interfere with > programming since it does all the work in the interactive spec (see > C-x ESC ESC for the show. BTW, can anybody tell me how the command > history manages to record the last two arguments unevaluated? I can't > for the life of me figure out how this works), so certainly no > security risk. I think moving the code into the interactive spec is not needed. There is no security risk in having it in the function body, because the `query-flag' argument of `perform-replace' is t, which means that even when the function `query-replace-regexp' is called non-interactively the user can see the replacement string and type `y' if he agrees with it. > If somebody has a good suggestion how one could get rid of > replace-requote in the command history, it would be nice to hear. > But I really think that \`"\\3"' should deliver a _verbatim_ \3, or > we could have written \`\3' in the first place. This imposes artificial restrictions on what the user can do. The user may want to construct a replacement string with backreferences in the Lisp expression. I think that only the user should decide whether he wants a verbatim \3 or its replacement. He can add backslashes for the literal meaning and write \`"\\\\3"' instead of \`"\\3"'. -- Juri Linkov http://www.jurta.org/emacs/