python: put smartparens advice in a post-config use-package hook

This commit is contained in:
syl20bnr 2018-05-20 00:24:29 -04:00
parent b3743701db
commit 9f6b45223f

View file

@ -382,16 +382,18 @@ fix this issue."
ad-do-it
(error nil))))
(defun python/post-init-smartparens ()
(defun python/pre-init-smartparens ()
(spacemacs/add-to-hooks 'smartparens-mode '(inferior-python-mode-hook
hy-mode-hook))
(defadvice python-indent-dedent-line-backspace
(around python/sp-backward-delete-char activate)
(let ((pythonp (or (not (bound-and-true-p smartparens-strict-mode))
(char-equal (char-before) ?\s))))
(if pythonp
ad-do-it
(call-interactively 'sp-backward-delete-char)))))
(spacemacs|use-package-add-hook smartparens
:post-config
(defadvice python-indent-dedent-line-backspace
(around python/sp-backward-delete-char activate)
(let ((pythonp (or (not smartparens-strict-mode)
(char-equal (char-before) ?\s))))
(if pythonp
ad-do-it
(call-interactively 'sp-backward-delete-char))))))
(defun python/post-init-stickyfunc-enhance ()
(add-hook 'python-mode-hook 'spacemacs/load-stickyfunc-enhance))