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 Date: Wed, 07 Jul 2004 08:11:43 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <876590iepc.fsf@mail.jurta.org> References: <876594drn6.fsf@mail.jurta.org> <87k6xjouj5.fsf@mail.jurta.org> <871xjp5uii.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 1089177223 19391 80.91.224.253 (7 Jul 2004 05:13:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Jul 2004 05:13:43 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jul 07 07:13: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 1Bi4kR-0007KX-00 for ; Wed, 07 Jul 2004 07:13:35 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bi4kQ-0001Pe-00 for ; Wed, 07 Jul 2004 07:13:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bi4mT-0000dX-M8 for emacs-devel@quimby.gnus.org; Wed, 07 Jul 2004 01:15:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bi4mP-0000dE-Pn for emacs-devel@gnu.org; Wed, 07 Jul 2004 01:15:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bi4mO-0000cY-43 for emacs-devel@gnu.org; Wed, 07 Jul 2004 01:15:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bi4mO-0000c5-0M for emacs-devel@gnu.org; Wed, 07 Jul 2004 01:15:36 -0400 Original-Received: from [66.33.205.9] (helo=spatula.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bi4kF-0005Av-0w; Wed, 07 Jul 2004 01:13:23 -0400 Original-Received: from mail.jurta.org (80-235-33-124-dsl.mus.estpak.ee [80.235.33.124]) by spatula.dreamhost.com (Postfix) with ESMTP id 2082D17D01C; Tue, 6 Jul 2004 22:13:19 -0700 (PDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Tue, 06 Jul 2004 18:00:10 -0400") 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:25516 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25516 Richard Stallman writes: > I misunderstood the idea of "(default a->b)". Now that I see what > it really does, I agree with you that it has lots of problems. > > Here's what I THOUGHT the idea was. > > The idea is that M-x query-replace would read just one minibuffer argument. > That argument would have the form FROM->TO. After the arg is read, > the interactive spec would split it apart at the -> to get the FROM > and TO strings, and they would become the arguments in the call > to query-replace. > > Further, the default for this one argument would be the previous > argument to query-replace. The default would be used if you type RET > and available to edit with M-n. > > This is radical, perhaps too radical, but it is clean and coherent. The original Stefan's idea was to display "(default a->b)" in the prompt for the from-string and to interpret empty input of the from-string as a request for repeating the last replacement. I extended this idea to what you described above, i.e. splitting the from-string argument in the form "FROM -> TO". This would be more consistent with standard Emacs handling of default values, but it has one drawback: the separator should not appear in the text to replace. But if the string " -> " is rare enough to appear in replacement strings we could use it as a default separator and to allow to quote it (e.g. " \-\> ") if someone really wants to use it in the from-string. -- Juri Linkov http://www.jurta.org/emacs/