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: improving query-replace and query-replace-regexp Date: Sun, 30 May 2004 23:59:57 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <873c5hd35q.fsf@mail.jurta.org> References: <20040528.182035.197345599.wl@gnu.org> <87k6yvorzf.fsf@mail.jurta.org> <20040529213132.GA31322@fencepost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085952476 25240 80.91.224.253 (30 May 2004 21:27:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 May 2004 21:27:56 +0000 (UTC) Cc: wl@gnu.org, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun May 30 23:27:49 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 1BUXqP-0001FI-00 for ; Sun, 30 May 2004 23:27:49 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BUXqP-0004eP-00 for ; Sun, 30 May 2004 23:27:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BUXqY-0000CK-8p for emacs-devel@quimby.gnus.org; Sun, 30 May 2004 17:27:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BUXqQ-0000CE-6L for emacs-devel@gnu.org; Sun, 30 May 2004 17:27:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BUXqO-0000Bz-C0 for emacs-devel@gnu.org; Sun, 30 May 2004 17:27:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BUXqO-0000Bw-2Y for emacs-devel@gnu.org; Sun, 30 May 2004 17:27:48 -0400 Original-Received: from [66.33.219.6] (helo=knife.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BUXoF-0006qp-HL; Sun, 30 May 2004 17:25:35 -0400 Original-Received: from mail.jurta.org (80-235-38-230-dsl.mus.estpak.ee [80.235.38.230]) by knife.dreamhost.com (Postfix) with ESMTP id 03CE2E40AB; Sun, 30 May 2004 14:25:32 -0700 (PDT) Original-To: Miles Bader 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:24248 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24248 Miles Bader writes: > On Sun, May 30, 2004 at 12:15:00AM +0300, Juri Linkov wrote: >> But an empty argument to M-% can't be used to repeat query-replace >> because the first argument of query-replace makes sense even when >> it is empty. It can be used to insert a replacement string between >> all characters, i.e. to change a string like "abcdef" into ";a;b;c;d;e;f;" >> by (query-replace "" ";"). This is an infrequent operation but >> still makes sense. > > I don't think it's frequent enough to matter; the "empty string inserts > between characters" usage is a kludgey hack, not something you expect people > to know about. I have no other objections to M-% RET. I only wanted to note that an empty argument makes sense, but since it's infrequent, RET is ok. There are other available methods to insert a string between all characters. I tried Stefan's implementation and it works fine. I have only one remark: if the last history item contains newlines, it may confuse users because it displays only the closing square bracket at the minibuffer prompt. -- Juri Linkov http://www.jurta.org/emacs/