Standardize REPL commands & improve SPC o r

- SPC o r now prompts for a REPL to open when none was found for the
  current buffer.
- REPL handlers must now follow the naming convention "*/open*-repl".
  e.g. +python/open-ipython-repl, +emacs-lisp/open-repl, etc.
- +eval/open-repl has been split in two:
  - +eval/open-repl-other-window
  - +eval/open-repl-same-window
This commit is contained in:
Henrik Lissner 2019-02-18 01:56:38 -05:00
parent 4437d80133
commit 94b16cba6c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
19 changed files with 83 additions and 52 deletions

View file

@ -4,7 +4,7 @@
"TODO")
;;;###autoload
(defun +python/repl ()
(defun +python/open-repl ()
"Open the Python REPL."
(interactive)
(unless python-shell-interpreter
@ -28,7 +28,7 @@
(interactive)
(let ((python-shell-interpreter "ipython")
(python-shell-interpreter-args +python-jupyter-repl-args))
(+python/repl)))
(+python/open-repl)))
;;;###autoload
(defun +python/open-jupyter-repl ()
@ -37,7 +37,7 @@
(add-to-list 'python-shell-completion-native-disabled-interpreters "jupyter")
(let ((python-shell-interpreter "jupyter")
(python-shell-interpreter-args (format "console %s" +python-jupyter-repl-args)))
(+python/repl)))
(+python/open-repl)))
(defun +python--extract-version (prefix str)
(when str

View file

@ -26,7 +26,7 @@ called.")
:config
(set-env! "PYTHONPATH" "PYENV_ROOT" "ANACONDA_HOME")
(set-electric! 'python-mode :chars '(?:))
(set-repl-handler! 'python-mode #'+python/repl)
(set-repl-handler! 'python-mode #'+python/open-repl)
(set-pretty-symbols! 'python-mode
;; Functional