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.
This commit is contained in:
Henrik Lissner 2024-07-09 21:53:50 -04:00
parent a4869f32e7
commit fe0548e820
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -302,6 +302,10 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(setq use-short-answers t) (setq use-short-answers t)
;; DEPRECATED: Remove when we drop 27.x support ;; DEPRECATED: Remove when we drop 27.x support
(advice-add #'yes-or-no-p :override #'y-or-n-p)) (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. ;; 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)) (setq minibuffer-prompt-properties '(read-only t intangible t cursor-intangible t face minibuffer-prompt))