From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josh Newsgroups: gmane.emacs.bugs Subject: bug#14708: 24.2; query-replace-regexp when match and replacement are the same Date: Mon, 24 Jun 2013 09:19:18 -0700 Message-ID: References: <7E039918541B4C4183BFDB8F015C74300E8E80@WCL-EXCH02.wcl.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1372090819 20144 80.91.229.3 (24 Jun 2013 16:20:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Jun 2013 16:20:19 +0000 (UTC) Cc: 14708@debbugs.gnu.org To: Ed Avis Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 24 18:20:16 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ur9V1-0001eJ-Iv for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2013 18:20:15 +0200 Original-Received: from localhost ([::1]:36064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur9V1-00037c-5M for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2013 12:20:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur9Uu-0002yW-Du for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2013 12:20:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ur9Ur-000590-TZ for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2013 12:20:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur9Ur-00058o-R2 for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2013 12:20:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Ur9Uo-0001Kx-Cj for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2013 12:20:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Josh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2013 16:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14708 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14708-submit@debbugs.gnu.org id=B14708.13720907975119 (code B ref 14708); Mon, 24 Jun 2013 16:20:02 +0000 Original-Received: (at 14708) by debbugs.gnu.org; 24 Jun 2013 16:19:57 +0000 Original-Received: from localhost ([127.0.0.1]:38870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ur9Ui-0001KV-VV for submit@debbugs.gnu.org; Mon, 24 Jun 2013 12:19:57 -0400 Original-Received: from mail-qc0-f169.google.com ([209.85.216.169]:34217) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ur9Ug-0001K8-EQ for 14708@debbugs.gnu.org; Mon, 24 Jun 2013 12:19:55 -0400 Original-Received: by mail-qc0-f169.google.com with SMTP id c10so6500427qcz.0 for <14708@debbugs.gnu.org>; Mon, 24 Jun 2013 09:19:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Dxk+F0m6sTA2vHqpNtgwvpI5D+/JtL2uQFwxvlc9mYs=; b=gfiibzx79NDTKE6VlNWczWajJKKgOGoqauk+dQ0DjIAWYyzUp0bqNPwrWZZPcZWsha E/qZD2OoROpbWNHiQwAZMzd1/ecpTjdvhh3c8xgb8Z0wGmEHnhmdHRGZnCUPCqbvpYFz DvUteAYMhmbTHuJudhMU96Kqe7KCqQYlEx8VciaYka8w2CIfFd0JWWuYOrs5LzLAXrSe OJ6N5EYJ9p/hWkhC0XOQbYtg4R3vpMhzJ5s6NsKetVkImV35ZdDSVqXndku6E1NE1Az7 SMNEQ6M23u8EOKaIJUELbM4N9gL0OyLWDvG03KRtgQgyQYj1wiDSp/UPiPmQTgMZaK9m v7kQ== X-Received: by 10.49.116.230 with SMTP id jz6mr19020395qeb.94.1372090788715; Mon, 24 Jun 2013 09:19:48 -0700 (PDT) Original-Received: by 10.49.30.41 with HTTP; Mon, 24 Jun 2013 09:19:18 -0700 (PDT) In-Reply-To: <7E039918541B4C4183BFDB8F015C74300E8E80@WCL-EXCH02.wcl.local> X-Google-Sender-Auth: mKsuW0dfyEH30VurvgCFAYELLU8 X-Gm-Message-State: ALoCoQnEtbawlkpXGNUG7h+32QNEn6CLL6IYy3ZWKFuQ7NqfsaIxTOZ7Mm7rFp2go3Gbyg+nlPqY X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75512 Archived-At: On Mon, Jun 24, 2013 at 4:44 AM, Ed Avis wrote: > Do M-x query-replace-regexp and enter ' +' as the regexp and ' ' > as the replacement text. Emacs matches each sequence of one or > more space characters, as specified in the regexp, and asks whether > to replace it. Why not target two or more spaces in the search expression, i.e. " +"? > However, for many of the cases the replacement text will be the same > as the match, so it makes no difference whether you replace or not. > Since the aim of query-replace-regexp is primarily to do a search > and replace, not to find all places in the buffer where a regexp > matches, it should instead skip over those cases and only ask about > places where replacing will make a difference. I wouldn't like it if Emacs were to behave that way, because when confirming a replacement would result in no change to the text it often indicates a broken regexp (as in this case) that I want to know about.