GNU bug report logs - #25591
25.1; M-% offers to repeat last search, but forgets that it was a "symbol" search

Previous Next

Package: emacs;

Reported by: Eric Hanchrow <eric.hanchrow <at> gmail.com>

Date: Tue, 31 Jan 2017 18:04:02 UTC

Severity: minor

Found in version 25.1

Full log


Message #11 received at 25591 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eric Hanchrow <eric.hanchrow <at> gmail.com>
Cc: 25591 <at> debbugs.gnu.org
Subject: Re: bug#25591: 25.1;
 M-% offers to repeat last search, but forgets that it was a "symbol"
 search
Date: Tue, 14 Feb 2017 02:00:01 +0200
> 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?




This bug report was last modified 8 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.