Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Conversation

vv111y
Copy link
Contributor

@vv111y vv111y commented Sep 30, 2019

For any major-mode, provide the option to override spacemacs repl related keybindings so that a jupyter repl is used instead.

  • SPC a j t Checks for kernel. Calls jupyter-repl-associate-buffer if there is no kernel for the buffer. I think check makes most sense here.
  • If there is no kernel for a language, emacs-jupyter will just give an error.
  • This override can be toggled on/off anytime.

Using spacemacs code as a guide:

  • looks like minor-mode keybindings should be in use-package :init
  • no consistent location to define a minor-mode, I saw 3 different places.

use-jupyter-eval-pop function for cleaner keybindings where the focus
goes to the repl buffer.
@vv111y
Copy link
Contributor Author

vv111y commented Oct 1, 2019

So far it's working on 2 machines.
Only minor issue is the first time you start a repl via SPC a j t, you have to do it twice to get the minor-mode on.

(defvar use-jupyter-repl-mode nil)
;; (defvar use-jupyter-repl-mode nil)

(define-minor-mode use-jupyter-repl-mode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a local package, i.e. a file and then loaded in packages.el, this might also fix needing to use the keybinging twice

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file should be in a subfolder local (see for example the +completion/helm layer with helm-spacemacs-help

'(
company
jupyter
smartparens
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. added here and then have an init-use-jupyter-repl...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like this (use-jupyter... :location local)

@vv111y vv111y force-pushed the override-major-keybindings branch from 98ba535 to d38864e Compare May 27, 2023 13:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants