Enable smartparens in eval-expression

Also don't treat ' as a pair, so we can quote lisp symbols.
This commit is contained in:
Tu Do 2015-03-31 12:18:59 +07:00 committed by syl20bnr
parent 284641c005
commit 835d565b3f

View file

@ -2486,6 +2486,18 @@ displayed in the mode-line.")
'smartparens-strict-mode
'smartparens-mode)
'(prog-mode-hook))
;; enable smartparens-mode in `eval-expression'
(defun conditionally-enable-smartparens-mode ()
"Enable `smartparens-mode' in the minibuffer, during `eval-expression'."
(if (eq this-command 'eval-expression)
(smartparens-mode)))
(add-hook 'minibuffer-setup-hook 'conditionally-enable-smartparens-mode)
;; don't create a pair with single quote in minibuffer
(sp-local-pair 'minibuffer-inactive-mode "'" nil :actions nil)
(setq sp-cancel-autoskip-on-backward-movement nil))
:config
(progn