From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Hanchrow Newsgroups: gmane.emacs.bugs Subject: bug#25591: 25.1; M-% offers to repeat last search, but forgets that it was a "symbol" search Date: Tue, 14 Feb 2017 00:32:22 +0000 Message-ID: References: <87bmu5d4la.fsf@localhost> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113ec75a309317054872b3e5 X-Trace: blaine.gmane.org 1487032393 30871 195.159.176.226 (14 Feb 2017 00:33:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 00:33:13 +0000 (UTC) Cc: 25591@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 14 01:33:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdR3L-0007dQ-SK for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 01:33:08 +0100 Original-Received: from localhost ([::1]:60236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdR3R-0000zt-Fa for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Feb 2017 19:33:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdR3L-0000zn-7t for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2017 19:33:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdR3G-0007Es-Ag for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2017 19:33:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdR3G-0007Ea-6r for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2017 19:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cdR3G-0006qM-0W for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2017 19:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Hanchrow Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2017 00:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25591 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25591-submit@debbugs.gnu.org id=B25591.148703236226277 (code B ref 25591); Tue, 14 Feb 2017 00:33:01 +0000 Original-Received: (at 25591) by debbugs.gnu.org; 14 Feb 2017 00:32:42 +0000 Original-Received: from localhost ([127.0.0.1]:39045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdR2v-0006pl-Kg for submit@debbugs.gnu.org; Mon, 13 Feb 2017 19:32:41 -0500 Original-Received: from mail-it0-f42.google.com ([209.85.214.42]:36513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdR2t-0006pY-6T for 25591@debbugs.gnu.org; Mon, 13 Feb 2017 19:32:39 -0500 Original-Received: by mail-it0-f42.google.com with SMTP id c7so10886289itd.1 for <25591@debbugs.gnu.org>; Mon, 13 Feb 2017 16:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Q/CiqG9h4cALw/vLytEsV3SfKCYvMhsrhvQTCsFpRJI=; b=ZDgqGjK43YcWAgcujBRJFJ3ZmNRDDCTZKIAjskEqs5qOQ6ADqgSg9uYPWDodlwQS+G nszjwDVMv4R/dlZAifgR7cK4WHdM5G2enXn4HT9O5nOXGCvLGMweIxsRjtNh/nl6W/Ua i1auwRX5/P1d2e5AX++wsoWh8rjI38wIekmlJVa+wkbQLyhfAsMBQYIMufziOvXeVUbB nACu3kPlY5cG4o44gV60Shp9V9EOpW0wrA3inqYIB1bChCAGFMOtnZ9UsgDsU859Zpp/ CZn1J3UiAYvITX/4my1/K52FI9r6XiM1GNnmm+tfOOqIyKJPCx1bEgok9ipBujCryC6Q KBag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q/CiqG9h4cALw/vLytEsV3SfKCYvMhsrhvQTCsFpRJI=; b=GXjzsKPyPybqM2fRk4uYDr76avOFjy8GqZ7RCCFDlfcyX+nW00j6+Gl1mjZfxU2KHp gc2T8z0h6dP/RyOXcOsjPZQqTRuyu85UhSBeFonPmIrelGgtV9+rc3+8Kn3Q+QUjbUjA phmevtrLNddD7RUHPtacH+X6fcxyUa4NXyoLNYtrLqK6GpqUZBnd/kUY0Lr/LoYoG8Bm Gj9L2nvJbzmBVU4OD4qpVKNGTH/LJOa2m+SYP5R5p/zkQmvPgtzEgj77q4n2PvKIS9mh V7VnCq8zvQMLPooTY4n/sTAzVogWCR4YhQyPkIue9OlIX4iEaoC99eAv6IOPC4i5Kxg2 bs4g== X-Gm-Message-State: AMke39nIYBj8uzqc9IG+Ctc17EA7eG3vn8LBt1CcnSgFyA5EQDCb7ok2vJJ+sClN1VaKaZlBgFWP6e4ABTZfig== X-Received: by 10.107.135.147 with SMTP id r19mr23865425ioi.36.1487032353328; Mon, 13 Feb 2017 16:32:33 -0800 (PST) In-Reply-To: <87bmu5d4la.fsf@localhost> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:129331 Archived-At: --001a113ec75a309317054872b3e5 Content-Type: text/plain; charset=UTF-8 Hm, I wasn't aware that M-% interprets the prefix arg to mean "word replace". My instinct says it should honor the explicit C-u. On Tue, Feb 14, 2017 at 12:09 AM Juri Linkov wrote: > I don't know if this is a bug, but it's disappointing and inconvenient. > > Start emacs with -Q, and type into the *scratch* buffer these 10 characters: > > I ate this > > Now do C-a to move point to the beginning of the line. > > Now replace the symbol "i" with "u": > > M-s _ i M-% u RET ! > > So far, so good: we are looking at > > U at this > > which is correct. > > Now try to repeat the replacement: > > C-a M-% RET ! > > This changes the "i" in "this" to a u, even though that "i" isn't an > independent symbol. I was hoping that it would do nothing. But what if you mistakenly invoked the replacement in wrong mode, and want to repeat the same replacement in the right one? E.g. first entered replacement strings in regexp replacement mode: C-M-% i RET u RET and then realized you want apply the same replacement strings in word mode: C-u M-% RET Should it perform word replacement as explicitly stated by the prefix arg C-u, or use a previous replacement type (in this case, regexp replacement) remembered in the replacement history? --001a113ec75a309317054872b3e5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hm, I wasn't awar= e that M-% interprets the prefix arg to mean "word replace".=C2= =A0 My instinct says it should honor the explicit C-u.

On Tue, Feb 14, 2017 at 12:09 AM Juri Linkov <juri@linkov.net&= gt; wrote:
> I don't know if this is a bug, but it's disappointing an= d inconvenient.
>
> Start emacs with -Q, and type into the *scratch* buffer these 10 chara= cters:
>
>=C2=A0 =C2=A0 =C2=A0I ate this
>
> Now do C-a to move point to the beginning of the line.
>
> Now replace the symbol "i" with "u":
>
>=C2=A0 =C2=A0 M-s _ i M-% u RET !
>
> So far, so good: we are looking at
>
>=C2=A0 =C2=A0 U at this
>
> which is correct.
>
> Now try to repeat the replacement:
>
>=C2=A0 =C2=A0 C-a M-% RET !
>
> This changes the "i" in "this" to a u, even though= that "i" isn't an
> independent symbol.=C2=A0 I was hoping that it would do nothing.

But what if you mistakenly invoked the replacement in wrong mode,
and want to repeat the same replacement in the right one?=C2=A0 E.g.
first entered replacement strings in regexp replacement mode:

C-M-% i RET u RET

and then realized you want apply the same replacement strings
in word mode:

C-u M-% RET

Should it perform word replacement as explicitly stated
by the prefix arg C-u, or use a previous replacement type
(in this case, regexp replacement) remembered in the
replacement history?
--001a113ec75a309317054872b3e5--