Skip to content

Commit

Permalink
*layers/+lang/python/packages.el: fix default python-shell-interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
sunlin7 authored and Lin Sun committed Jul 17, 2023
1 parent d0d0141 commit 4c9bb76
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions layers/+lang/python/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,6 @@
"sl" 'spacemacs/python-shell-send-line
"ss" 'spacemacs/python-shell-send-with-output)

(setq spacemacs--python-shell-interpreter-origin
(eval (car (get 'python-shell-interpreter 'standard-value))))
;; Set `python-indent-guess-indent-offset' to `nil' to prevent guessing `python-indent-offset
;; (we call python-indent-guess-indent-offset manually so python-mode does not need to do it)
(setq-default python-indent-guess-indent-offset nil)
Expand Down Expand Up @@ -449,10 +447,16 @@
;; add this optional key binding for Emacs user, since it is unbound
(define-key inferior-python-mode-map
(kbd "C-c M-l") 'spacemacs/comint-clear-buffer)

(setq spacemacs--python-shell-interpreter-origin
(eval (car (get 'python-shell-interpreter 'standard-value))))
;; setup the global variables for python shell
(spacemacs//python-setup-shell default-directory)
(dolist (x '(python-shell-interpreter python-shell-interpreter-args))
(set-default-toplevel-value x (symbol-value x))))))
(when (equal python-shell-interpreter spacemacs--python-shell-interpreter-origin)
(spacemacs//python-setup-shell default-directory)
(when python-shell-interpreter
(setq spacemacs--python-shell-interpreter-origin python-shell-interpreter)
(dolist (x '(python-shell-interpreter python-shell-interpreter-args))
(set-default-toplevel-value x (symbol-value x))))))))

(defun python/post-init-semantic ()
(when (configuration-layer/package-used-p 'anaconda-mode)
Expand Down

0 comments on commit 4c9bb76

Please sign in to comment.