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 18:23:44 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87n033y0yj.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> <87llin98sc.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 1087400512 4551 80.91.224.253 (16 Jun 2004 15:41:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 Jun 2004 15:41:52 +0000 (UTC) Cc: schwab@suse.de, emacs-devel@gnu.org, storm@cua.dk Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jun 16 17:41:40 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 1BacXk-0000Zj-00 for ; Wed, 16 Jun 2004 17:41:40 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BacXk-0004MJ-00 for ; Wed, 16 Jun 2004 17:41:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BacYk-0001n2-5q for emacs-devel@quimby.gnus.org; Wed, 16 Jun 2004 11:42:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BacYU-0001ln-63 for emacs-devel@gnu.org; Wed, 16 Jun 2004 11:42:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BacYR-0001kD-E1 for emacs-devel@gnu.org; Wed, 16 Jun 2004 11:42:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BacYR-0001jp-5J for emacs-devel@gnu.org; Wed, 16 Jun 2004 11:42:23 -0400 Original-Received: from [66.33.216.126] (helo=kungfu.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BacX3-0003us-N8; Wed, 16 Jun 2004 11:40:58 -0400 Original-Received: from spatula.dreamhost.com (spatula.dreamhost.com [66.33.205.9]) by kungfu.dreamhost.com (Postfix) with ESMTP id 34D631EDD73; Wed, 16 Jun 2004 08:40:57 -0700 (PDT) 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 DE88E17D03E; Wed, 16 Jun 2004 08:37:44 -0700 (PDT) Original-To: David Kastrup In-Reply-To: (David Kastrup's message of "16 Jun 2004 16:35:18 +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:25035 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25035 David Kastrup writes: > David Kastrup writes: >> Just working on a newer version right now. > > Ok, here is my current version (apart from documentation which needs > to get added to several places, of course). I've stolen some > improvements from Juri in the course, but the pleasure's mutual. That's fine with me. I like to cooperate and share code. > I have not added the \? proposal yet as I feel it of dubious utility: > without a proper prompt string, it will probably feel unconvenient to > use in particular where several \? occur, and I don't see a good > syntax for prompt strings: mandating them to be LF-ended would > require C-q C-j even when you don't want them after all, and you can > easily do them with > \,(read-string "My prompt") > anyway. Maybe a fixed space-terminated (not-escapable) prompt would > do, like > \? xxx > to get no particular prompt string and > \?veracity xxx > to get "veracity" as a prompt. > > But I really don't like that too much. I think \? is really useful even without a proper prompt string. Often there is a need to prompt only for one replacement string in cases like: #define X 0x001 #define Y 0x002 #define Z 0x003 it would be easy to do it with a simple \?: C-M-% ^ RET #define \? 0x\# RET It is not important what question it asks. It would work even for two or three different \? in one replacement string. In rare cases where the user needs more \?, he can use \,(read-string "My prompt: "). Or to let it to automatically enumerate prompt strings, i.e. to have a counter in expression generating code in `query-replace-regexp' that will convert several \? in the same string into prompts in a fixed format with the prompt counter added to the prompt string: (concat (read-string "Enter string 1: ") (read-string "Enter string 2: ")) -- Juri Linkov http://www.jurta.org/emacs/