Fix smartparens-strict-mode for python

This commit is contained in:
syl20bnr 2014-12-11 22:16:09 -05:00
parent 3f751e3a4e
commit 2ac8658385

View file

@ -9,6 +9,7 @@
pyvenv
python
semantic
smartparens
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
@ -138,3 +139,12 @@ which require an initialization must be listed explicitly in the list.")
;; required to correctly load semantic mode
;; using the python-mode-hook triggers an error about a deleted buffer.
(eval-after-load 'python '(semantic-mode 1)))
(defun python/init-smartparens ()
(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)))))