Enable smartparens in eval-expression

This is experimental, so we can have delimiter/quote autopairing while
we write lisp into eval-expression.
This commit is contained in:
Henrik Lissner 2018-06-16 11:41:07 +02:00
parent b656e68bc3
commit c81304d18b
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 7 additions and 1 deletions

View file

@ -186,7 +186,7 @@ possible, or just one char if that's not possible."
(insert-char ?\s (- ocol (current-column)) nil)))) (insert-char ?\s (- ocol (current-column)) nil))))
;; ;;
((and (= n 1) ((and (= n 1)
(not (minibufferp))) (bound-and-true-p smartparens-mode))
(cond ((and (memq (char-before) (list ?\ ?\t)) (cond ((and (memq (char-before) (list ?\ ?\t))
(save-excursion (save-excursion
(and (> (- (skip-chars-backward " \t" (line-beginning-position))) 0) (and (> (- (skip-chars-backward " \t" (line-beginning-position))) 0)

View file

@ -151,6 +151,12 @@ fundamental-mode) for performance sake."
(add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode) (add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode)
(add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode) (add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode)
(defun doom|init-smartparens-in-eval-expression ()
"Enable `smartparens-mode' in the minibuffer, during `eval-expression'."
(when (eq this-command 'eval-expression)
(smartparens-mode)))
(add-hook 'minibuffer-setup-hook #'doom|init-smartparens-in-eval-expression)
(sp-local-pair '(xml-mode nxml-mode php-mode) "<!--" "-->" (sp-local-pair '(xml-mode nxml-mode php-mode) "<!--" "-->"
:post-handlers '(("| " "SPC"))) :post-handlers '(("| " "SPC")))