From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dani Moncayo Newsgroups: gmane.emacs.bugs Subject: bug#12526: 24.2.50; `query-replace-interactive' not always respected Date: Thu, 4 Oct 2012 10:39:32 +0200 Message-ID: References: <877gr8obbs.fsf@mail.jurta.org> <878vbnnmmc.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1349402039 26336 80.91.229.3 (5 Oct 2012 01:53:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Oct 2012 01:53:59 +0000 (UTC) Cc: 12526@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 05 03:54:04 2012 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 1TJx51-0006Y7-EG for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Oct 2012 03:51:55 +0200 Original-Received: from localhost ([::1]:46239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJgyY-0007ir-6b for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Oct 2012 04:40:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJgyU-0007fV-Hb for bug-gnu-emacs@gnu.org; Thu, 04 Oct 2012 04:40:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJgyM-0000YH-QG for bug-gnu-emacs@gnu.org; Thu, 04 Oct 2012 04:40:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJgyM-0000YD-M0 for bug-gnu-emacs@gnu.org; Thu, 04 Oct 2012 04:39:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TJgyQ-0006pi-3w for bug-gnu-emacs@gnu.org; Thu, 04 Oct 2012 04:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dani Moncayo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Oct 2012 08:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12526-submit@debbugs.gnu.org id=B12526.134933998526239 (code B ref 12526); Thu, 04 Oct 2012 08:40:01 +0000 Original-Received: (at 12526) by debbugs.gnu.org; 4 Oct 2012 08:39:45 +0000 Original-Received: from localhost ([127.0.0.1]:52309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TJgy9-0006p9-6D for submit@debbugs.gnu.org; Thu, 04 Oct 2012 04:39:45 -0400 Original-Received: from mail-ob0-f172.google.com ([209.85.214.172]:55805) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TJgy6-0006ow-5R for 12526@debbugs.gnu.org; Thu, 04 Oct 2012 04:39:43 -0400 Original-Received: by mail-ob0-f172.google.com with SMTP id v19so221024obq.3 for <12526@debbugs.gnu.org>; Thu, 04 Oct 2012 01:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wRokeaS4RLTaAOLvxxWXMdht+AqGVeY3Z2YeohDBzog=; b=f6IYw2ijHvSJLHFp4KkFpONIhGSwAk2W+j/0qKbr+yl7Guxn/qvMMZn9kW7TC2ZFU8 7UqrgyRDfz9zqP/y/QRR6Diswzw9x775ujUMaBG+J5b+oU4Ne9onOBKrHIUrMdG0WlYl 8PfgCg5OR2iFil7VHF8pHju+fuUwkhJJis6wXGCHI43UkTvJwRKD6F+EoaaCoBPL/6mr f4avJf8R0Fdjrud5qxN6awa2yyWZiX2COIOiTLZKKEqOp1VKEG25JJhsVf0qdgQtO6UK 65VoFiztQEv3JcR9Fj9+BHGFA0TM9+Mj2RJKxCDyC2vxncEt3KosGgAvswry5hTMqeY4 YPQA== Original-Received: by 10.60.30.168 with SMTP id t8mr3702151oeh.89.1349339972424; Thu, 04 Oct 2012 01:39:32 -0700 (PDT) Original-Received: by 10.60.4.132 with HTTP; Thu, 4 Oct 2012 01:39:32 -0700 (PDT) In-Reply-To: <878vbnnmmc.fsf@mail.jurta.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:65205 Archived-At: >>>> 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. > > Thanks for the suggestion. I fixed this docstring in the patch below. Good, thanks. >> Also, the docstring of `query-replace-interactive' should be update >> for the same reason. > > Since it's easy to do `C-s C-s M-%' to replace the last search string, > the option `query-replace-interactive' is useless now and can be > declared obsolete. Another reason to remove it is your suggestion below > to use `M-% M-n' as its replacement. As I said before, I think it is unsuitable to assume that the user always wants to use the last search string as "from" string in query-replace (when query-replace is invoked from Isearch). It is much better to let the user decide, i.e., to always prompt for the "from" string in the minibuffer. If the user wants to use the last search string, it is pretty easy to type `M-n'. At least, please, make this behavior optional. >> I'd like to set some user-option in my init file so that query-replace >> never assumes nothing about the "from" string. > > If you don't want to use `define-key' for configuration purposes, > we might consider using an user option, but not `query-replace-interactive' > that is irrelevant for isearch. > > Such an option has been discussed but not yet implemented. > To get an idea how this option could work, please see bug#9706 > and its related thread on emacs-devel. With this new option, > you will be able to define any command (not only `query-replace') > to bypass its isearch keybinding to its original command. I fail to see exactly how that is related to the problem discussed here, but I think that the proper fix here is simpler (see my previous comment). >> 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. > > Two weeks ago I added the last search string to `C-M-% M-n'. > But it's still missing for `M-% M-n'. Thank you for noticing this omission. > This is fixed in the patch below. This is another reason > to declare `query-replace-interactive' obsolete because now > there are two functional replacements for it as is documented > in the fixed docstrings. > > Also I verified that "Query replace (default foo -> bar): RET" > still works correctly and empty input redoes the last replace. Ok, thank you for working on this. -- Dani Moncayo