From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#25591: 25.1; M-% offers to repeat last search, but forgets that it was a "symbol" search Date: Wed, 15 Feb 2017 01:11:32 +0200 Organization: LINKOV.NET Message-ID: <87fujgqsez.fsf@localhost> References: <87bmu5d4la.fsf@localhost> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1487115020 3389 195.159.176.226 (14 Feb 2017 23:30:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 23:30:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu) Cc: 25591@debbugs.gnu.org To: Eric Hanchrow Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 15 00:30:16 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 1cdmY2-0000VO-H6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Feb 2017 00:30:14 +0100 Original-Received: from localhost ([::1]:37712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdmY8-0001hQ-82 for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 18:30:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdmXv-0001eV-E7 for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 18:30:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdmXs-0006kO-Rv for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 18:30:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdmXs-0006k3-PC for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 18:30:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cdmXs-0005DF-K7 for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 18:30:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2017 23:30:04 +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.148711499919984 (code B ref 25591); Tue, 14 Feb 2017 23:30:04 +0000 Original-Received: (at 25591) by debbugs.gnu.org; 14 Feb 2017 23:29:59 +0000 Original-Received: from localhost ([127.0.0.1]:40308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdmXm-0005CG-Uh for submit@debbugs.gnu.org; Tue, 14 Feb 2017 18:29:59 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:48255 helo=homiemail-a39.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdmXk-0005C1-LR for 25591@debbugs.gnu.org; Tue, 14 Feb 2017 18:29:57 -0500 Original-Received: from homiemail-a39.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTP id 876A015006D; Tue, 14 Feb 2017 15:29:55 -0800 (PST) Original-Received: from localhost.linkov.net (m83-191-240-183.cust.tele2.ee [83.191.240.183]) (Authenticated sender: jurta@jurta.org) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTPA id B7D93150069; Tue, 14 Feb 2017 15:29:54 -0800 (PST) In-Reply-To: (Eric Hanchrow's message of "Tue, 14 Feb 2017 00:32:22 +0000") 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:129365 Archived-At: > 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. Even in your example, wouldn't it be confusing if after typing C-a M-% RET ! and seeing this non-symbol prompt Query replace (default i =E2=86=92 u): replacement will still be symbol-based (because the previous replacement was symbol-based)? To be not confusing the prompt should show explicitly the replacement type, e.g. in case of symbol replacement: Query replace symbol (default i =E2=86=92 u): When we'll store the replacement type in the history, then maybe display previous replacements in the minibuffer like Query replace (default symbol i =E2=86=92 u): then typing M-p will pull a previous replacement into the minibuffer, e.g. word-based: Query replace (default symbol i =E2=86=92 u): word foo =E2=86=92 bar where =E2=80=9Cword=E2=80=9D is intangible part of the prompt. >>> I don't know if this is a bug, but it's disappointing and inconvenien= t. >>> >>> Start emacs with -Q, and type into the *scratch* buffer these 10 char= acters: >>> >>> 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?