From 8463c1bb8a31deb619dfdc323b28dae9c183adc3 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 31 Jul 2024 12:21:39 +0200 Subject: [PATCH] Ensure SPC is self-inserting when reading kubectl command line * cobra.el (cobra-read-command-line): Ensure SPC key is self-inserting in the minibuffer. --- cobra.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cobra.el b/cobra.el index 8efb3e2..1fdbabe 100644 --- a/cobra.el +++ b/cobra.el @@ -129,8 +129,15 @@ Perform completion action A on string S with predicate P." Optional argument HIST is the name of the history list variable to use, if it is nil or omitted, it defaults to `shell-command-history'." (let ((exec (car (split-string-and-unquote initial)))) - (completing-read prompt (apply-partially #'cobra-completion-table exec) - nil nil initial (or hist 'shell-command-history)))) + (minibuffer-with-setup-hook + (:append (lambda () + (let ((map (make-sparse-keymap))) + ;; Ensure SPC is self-inserting. + (keymap-unset map "SPC") + (use-local-map + (make-composed-keymap map (current-local-map)))))) + (completing-read prompt (apply-partially #'cobra-completion-table exec) + nil nil initial (or hist 'shell-command-history))))) (provide 'cobra) ;;; cobra.el ends here -- 2.39.2