0

How do I change the octave-mode to use the command jupyter kernel --kernel octave as the default octave shell?

Edit: Here's a list of things I tried (adding them here as suggested in the comments):

  1. Changed the variable inferior-octave-program using:
(eval-after-load 'octave (setq inferior-octave-program "jupyter console --kernel octave"))

This however gives the error: Searching for program: No such file or directory, jupyter console --kernel octave. And yes, I do have jupyter and octave_kernel installed and can launch it from terminal with jupyter console --kernel octave.

Nidish Narayanaa
  • 338
  • 3
  • 12

1 Answers1

0

Untested - customize the variable inferior-octave-program; or if you prefer to do things manually, add the following to your emacs init file:

(eval-after-load 'octave (setq inferior-octave-program "jupyter kernel --kernel octave"))

The doc string for inferior-octave-program says:

inferior-octave-program is a variable defined in ‘octave.el’. Its value is "octave"

This variable may be risky if used as a file-local variable. You can customize this variable.

Documentation: Program invoked by ‘inferior-octave’.

NickD
  • 5,937
  • 1
  • 21
  • 38
  • This was indeed one of the first things i tried and it doesn't work. It gives me a `Searching for program: No such file or directory, jupyter console --kernel octave` error. And yes, I do have jupyter and octave_kernel installed and can launch it from terminal with `jupyter console --kernel octave`. – Nidish Narayanaa Aug 22 '20 at 01:15
  • That's probably (still an untested guess ;-) ) because it tries to exec the string. Try putting the command in a script (say `/usr/local/bin/joctave`), make it executable and then assign that to `inferior-octave-program`. – NickD Aug 22 '20 at 02:57
  • BTW, you should have mentioned that you had tried that in your question. – NickD Aug 22 '20 at 02:58
  • Thanks, I've edited the question. I tried creating a local script, but now it just makes Emacs hang until I hit `ctrl-g` without ever launching an inferior octave buffer! – Nidish Narayanaa Aug 22 '20 at 22:46