From 9e56927b5f8cbbdffdb9a397e9f564b347103223 Mon Sep 17 00:00:00 2001 From: Nikita Bloshchanevich Date: Wed, 9 Dec 2020 21:51:00 +0100 Subject: [PATCH] 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. --- core/core-editor.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index e8e768816..9ef3b0127 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -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: