Skip to content

Commit c505fde

Browse files
committed
python: put anaconda-mode dir in cache dir
1 parent 6a520b6 commit c505fde

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ server/
3838
/*.zip
3939
*.db
4040
python-*-docs-html
41-
anaconda-mode/
4241

4342
# Private directory
4443
private/*

layers/+lang/python/packages.el

+20-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,26 @@
3737
(defun python/init-anaconda-mode ()
3838
(use-package anaconda-mode
3939
:defer t
40-
:init (add-hook 'python-mode-hook 'anaconda-mode)
40+
:init
41+
(progn
42+
(defun spacemacs//set-anaconda-mode-directory ()
43+
;; hack to redefine the variable `anaconda-mode-server-directory'
44+
;; we need to do this to retrieve the server version and
45+
;; then redefine the variable
46+
(unless (string-match-p spacemacs-cache-directory
47+
anaconda-mode-server-directory)
48+
(makunbound 'anaconda-mode-ensure-directory-command)
49+
(makunbound 'anaconda-mode-check-installation-command)
50+
(makunbound 'anaconda-mode-install-server-command)
51+
(setq features (delq 'anaconda-mode features))
52+
(setq anaconda-mode-server-directory
53+
(concat spacemacs-cache-directory
54+
"anaconda-mode/"
55+
anaconda-mode-server-version))
56+
(require 'anaconda-mode)))
57+
(spacemacs/add-to-hook 'python-mode-hook
58+
'(spacemacs//set-anaconda-mode-directory
59+
anaconda-mode)))
4160
:config
4261
(progn
4362
(evil-leader/set-key-for-mode 'python-mode

0 commit comments

Comments
 (0)