From fe0548e820ff0fb9f3096a7f49847aa3c4e174cc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 9 Jul 2024 21:53:50 -0400 Subject: [PATCH] tweak: unbind SPC in y-or-n-p prompts SPC is equivalent to y when y-or-n-p prompts you, which seems way too easy to hit by accident, especially with our leader key being (or involving) SPC by default. --- lisp/doom-ui.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/doom-ui.el b/lisp/doom-ui.el index 7ef918cfa..6f4aa5eee 100644 --- a/lisp/doom-ui.el +++ b/lisp/doom-ui.el @@ -302,6 +302,10 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (setq use-short-answers t) ;; DEPRECATED: Remove when we drop 27.x support (advice-add #'yes-or-no-p :override #'y-or-n-p)) +;; HACK: By default, SPC = yes when `y-or-n-p' prompts you (and +;; `y-or-n-p-use-read-key' is off). This seems too easy to hit by accident, +;; especially with SPC as our default leader key. +(define-key y-or-n-p-map " " nil) ;; Try to keep the cursor out of the read-only portions of the minibuffer. (setq minibuffer-prompt-properties '(read-only t intangible t cursor-intangible t face minibuffer-prompt))