GNU bug report logs - #12526
24.2.50; `query-replace-interactive' not always respected

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 27 Sep 2012 13:05:01 UTC

Severity: normal

Found in version 24.2.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


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

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 12526 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#12526: 24.2.50;
	`query-replace-interactive' not always respected
Date: Wed, 3 Oct 2012 12:00:05 +0200
>> Is that feature documented somewhere?
>
> Yes, it is documented in the Info node
> (info "(emacs) Special Isearch")

Ok, but definitely the docstring of query-replace should be updated,
because currently it is misleading:
  If `query-replace-interactive' is non-nil, the last incremental search
  string is used as FROM-STRING--you don't have to specify it with the
  minibuffer.

This paragraph is incomplete (and therefore misleading) because it
doesn't explain the behavior I complained about.

Also, the docstring of `query-replace-interactive' should be update
for the same reason.

>> Is there a way to disable that feature?
>
> Yes, you can easily disable this feature
> by adding this keybinding to your init file:
>
> (define-key isearch-mode-map [?\M-%]
>   (lambda ()
>     (interactive)
>     (isearch-exit)  ;; I'm too lazy to terminate search with RET.
>     (call-interactively 'query-replace)))


This is an ugly solution, IMO.  I don't want to define a new command
and bind M-% to it;

I'd like to set some user-option in my init file so that query-replace
never assumes nothing about the "from" string.

BTW: I think that a much better approach would be to add the last
search string to the list of default arguments, so that, after an
Isearch, I could do `M-% M-n' if I wanted to retrieve that last search
string.

-- 
Dani Moncayo




This bug report was last modified 12 years and 318 days ago.

Previous Next


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