From 2d1bed560fda9acbfa9913053e72d964a9c7687c Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Mon, 26 Jul 2021 12:33:54 +0200 Subject: [PATCH] Add consult-crm-map: See #353 --- consult.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/consult.el b/consult.el index 812ec1fb..c0d5fcc2 100644 --- a/consult.el +++ b/consult.el @@ -1621,6 +1621,9 @@ ARGS is a list of `make-process' properties and transforms." map) "Keymap added for commands with asynchronous candidates.") +(defvar consult-crm-map (make-sparse-keymap) + "Keymap added by `consult-completing-read-multiple'.") + (defvar consult-preview-map (make-sparse-keymap) "Keymap added for commands with preview.") @@ -2308,7 +2311,8 @@ See `completing-read-multiple' for the documentation of the arguments." (when-let (pos (string-match-p "\\(?: (default[^)]+)\\)?: \\'" prompt)) (setq overlay (make-overlay (+ (point-min) pos) (+ (point-min) (length prompt)))) (when selected - (overlay-put overlay 'display (format " (%s selected): " (length selected)))))) + (overlay-put overlay 'display (format " (%s selected): " (length selected))))) + (use-local-map (make-composed-keymap (list consult-crm-map) (current-local-map)))) (unwind-protect (progn (add-hook 'pre-command-hook hook 90)