python: move disable semantic hook to anaconda init function

This commit is contained in:
syl20bnr 2016-04-12 22:38:48 -04:00
parent 5d84473fca
commit 6c2665e0f7
2 changed files with 9 additions and 4 deletions

View file

@ -58,3 +58,9 @@
(pyenv-mode-set version)
(message "pyenv: version `%s' is not installed (set by %s)"
version file-path))))))
(defun spacemacs//disable-semantic-idle-summary-mode ()
" Disable semantic-idle-summary in Python mode.
Anaconda provides more useful information but can not do it properly
when this mode is enabled since the minibuffer is cleared all the time."
(semantic-idle-summary-mode 0))

View file

@ -44,7 +44,9 @@
(progn
(setq anaconda-mode-installation-directory
(concat spacemacs-cache-directory "anaconda-mode"))
(add-hook 'python-mode-hook 'anaconda-mode))
(add-hook 'python-mode-hook 'anaconda-mode)
(add-hook 'python-mode-hook
'spacemacs//disable-semantic-idle-summary-mode t))
:config
(progn
(spacemacs/set-leader-keys-for-major-mode 'python-mode
@ -394,9 +396,6 @@
(defun python/post-init-semantic ()
(add-hook 'python-mode-hook 'semantic-mode)
(when (configuration-layer/package-usedp 'anaconda-mode)
(add-hook 'python-mode-hook (lambda () (semantic-idle-summary-mode 0)) t))
(defadvice semantic-python-get-system-include-path
(around semantic-python-skip-error-advice activate)
"Don't cause error when Semantic cannot retrieve include