From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#20687: 25.0.50; `perform-replace' should invoke a key that you have bound in `query-replace-map' Date: Wed, 03 Jun 2015 01:01:39 +0300 Organization: LINKOV.NET Message-ID: <873829u5vg.fsf@mail.linkov.net> References: <87pp5fb172.fsf@mail.linkov.net> <890ac68c-1c71-49c7-9e60-45afba90d74a@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433282791 2377 80.91.229.3 (2 Jun 2015 22:06:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Jun 2015 22:06:31 +0000 (UTC) Cc: 20687@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 03 00:06:19 2015 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 1YzuK5-0007JF-JT for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Jun 2015 00:06:13 +0200 Original-Received: from localhost ([::1]:32817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzuK4-0002XO-OB for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jun 2015 18:06:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzuJz-0002Wc-I7 for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 18:06:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzuJu-0004eO-GB for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 18:06:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzuJu-0004eK-CL for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 18:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YzuJt-0007JW-V4 for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 18:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Jun 2015 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20687 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20687-submit@debbugs.gnu.org id=B20687.143328273328040 (code B ref 20687); Tue, 02 Jun 2015 22:06:01 +0000 Original-Received: (at 20687) by debbugs.gnu.org; 2 Jun 2015 22:05:33 +0000 Original-Received: from localhost ([127.0.0.1]:38005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzuJQ-0007I6-Up for submit@debbugs.gnu.org; Tue, 02 Jun 2015 18:05:33 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:51929 helo=homiemail-a100.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzuJN-0007Ht-Vd for 20687@debbugs.gnu.org; Tue, 02 Jun 2015 18:05:30 -0400 Original-Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id 4F60931A073; Tue, 2 Jun 2015 15:05:29 -0700 (PDT) Original-Received: from localhost.linkov.net (m83-176-9-1.cust.tele2.ee [83.176.9.1]) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPA id 5CD7F31A070; Tue, 2 Jun 2015 15:05:28 -0700 (PDT) In-Reply-To: <890ac68c-1c71-49c7-9e60-45afba90d74a@default> (Drew Adams's message of "Mon, 1 Jun 2015 14:11:42 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:103521 Archived-At: > The point is that a user can do that (that's what keymaps and > key bindings are for), but currently `perform-replace' refuses to > recognize such a key and its command. I see there are already commands (as opposed to special internal values such as `act' and `skip') in query-replace-map: (define-key map "\C-v" 'scroll-up) (define-key map "\M-v" 'scroll-down) (define-key map [next] 'scroll-up) (define-key map [prior] 'scroll-down) (define-key map [?\C-\M-v] 'scroll-other-window) (define-key map [M-next] 'scroll-other-window) (define-key map [?\C-\M-\S-v] 'scroll-other-window-down) (define-key map [M-prior] 'scroll-other-window-down) These bindings look like real commands intended to be called interactively, so after enabling this feature in query-replace they will start doing their job which is good. The only suggestion I have is to check whether the binding is a command before trying to call it, i.e.: diff --git a/lisp/replace.el b/lisp/replace.el index 1bf1343..503531a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2404,6 +2404,8 @@ (defun perform-replace (from-string replacements (replace-dehighlight) (save-excursion (recursive-edit)) (setq replaced t)) + ((commandp def t) + (call-interactively def)) ;; Note: we do not need to treat `exit-prefix' ;; specially here, since we reread ;; any unrecognized character.