Enable smartparens for `edebug-eval-expression'

`doom-init-smartparens-in-minibuffer-maybe-h' is responsible for enabling
`smartparens' in the minibuffer, which it does by checking `this-command'.
However, the list of commands doesn't include `edebug-eval-expression',
preventing the mode from being enabled for it.

Fix this by enabling `smartparens' in `eval-expression-minibuffer-setup-hook',
unconditionally, which means that anything using `interactive' "x" or
`read--expression' will work correctly.
This commit is contained in:
Nikita Bloshchanevich 2020-12-09 21:51:00 +01:00
parent 92c9127b86
commit 9e56927b5f

View file

@ -498,13 +498,11 @@ files, so we replace calls to `pp' with the much faster `prin1'."
(dolist (key '(:unmatched-expression :no-matching-tag))
(setf (alist-get key sp-message-alist) nil))
(add-hook! 'minibuffer-setup-hook
(add-hook! 'eval-expression-minibuffer-setup-hook
(defun doom-init-smartparens-in-minibuffer-maybe-h ()
"Enable `smartparens-mode' in the minibuffer, during `eval-expression',
`pp-eval-expression' or `evil-ex'."
(and (memq this-command '(eval-expression pp-eval-expression evil-ex))
smartparens-global-mode
(smartparens-mode))))
"Enable `smartparens-mode' in the minibuffer for `eval-expression'.
Only enable it if `smartparens-global-mode' is on."
(when smartparens-global-mode (smartparens-mode))))
;; You're likely writing lisp in the minibuffer, therefore, disable these
;; quote pairs, which lisps doesn't use for strings: