all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: 20687@debbugs.gnu.org
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	[thread overview]
Message-ID: <873829u5vg.fsf@mail.linkov.net> (raw)
In-Reply-To: <890ac68c-1c71-49c7-9e60-45afba90d74a@default> (Drew Adams's message of "Mon, 1 Jun 2015 14:11:42 -0700 (PDT)")

> 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.





  reply	other threads:[~2015-06-02 22:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 21:12 bug#20687: 25.0.50; `perform-replace' should invoke a key that you have bound in `query-replace-map' Drew Adams
2015-06-01 20:53 ` Juri Linkov
2015-06-01 21:11   ` Drew Adams
2015-06-02 22:01     ` Juri Linkov [this message]
2015-06-02 22:12       ` Drew Adams
2020-09-17 18:11       ` Lars Ingebrigtsen
2015-06-02 13:08 ` Kaushal
2015-06-02 22:02   ` Juri Linkov
2015-06-02 22:50     ` Drew Adams
2015-06-03  3:35       ` Kaushal
2015-06-03  4:39         ` Drew Adams
2015-06-03  5:10           ` Kaushal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873829u5vg.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=20687@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.