mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
Add a better mode-line string for jupyter-repl-interaction-mode
This commit is contained in:
parent
6d4efb9823
commit
1242d05972
1 changed files with 15 additions and 1 deletions
|
@ -2739,6 +2739,20 @@ Only intended to be added as advice to `switch-to-buffer',
|
||||||
(eq (jupyter-repl-language-mode jupyter-current-client) major-mode))
|
(eq (jupyter-repl-language-mode jupyter-current-client) major-mode))
|
||||||
(jupyter-repl-interaction-mode)))
|
(jupyter-repl-interaction-mode)))
|
||||||
|
|
||||||
|
(defun jupyter-repl-interaction-mode-line ()
|
||||||
|
"Return a mode line string with the status of the kernel.
|
||||||
|
'*' means the kernel is busy, '-' means the kernel is idle and
|
||||||
|
the REPL is connected, 'x' means the REPL is disconnected
|
||||||
|
from the kernel."
|
||||||
|
(and (jupyter-repl-client-p jupyter-current-client)
|
||||||
|
(concat " JuPy["
|
||||||
|
(if (equal (oref jupyter-current-client execution-state) "busy")
|
||||||
|
"*"
|
||||||
|
(if (jupyter-hb-beating-p jupyter-current-client)
|
||||||
|
"-"
|
||||||
|
"x"))
|
||||||
|
"]")))
|
||||||
|
|
||||||
(define-minor-mode jupyter-repl-interaction-mode
|
(define-minor-mode jupyter-repl-interaction-mode
|
||||||
"Minor mode for interacting with a Jupyter REPL.
|
"Minor mode for interacting with a Jupyter REPL.
|
||||||
When this minor mode is enabled you may evaluate code from the
|
When this minor mode is enabled you may evaluate code from the
|
||||||
|
@ -2751,7 +2765,7 @@ the `current-buffer' will automatically have
|
||||||
|
|
||||||
\\{jupyter-repl-interaction-map}"
|
\\{jupyter-repl-interaction-map}"
|
||||||
:group 'jupyter-repl
|
:group 'jupyter-repl
|
||||||
:lighter " JuPy"
|
:lighter '(:eval (jupyter-repl-interaction-mode-line))
|
||||||
:init-value nil
|
:init-value nil
|
||||||
:keymap jupyter-repl-interaction-map
|
:keymap jupyter-repl-interaction-map
|
||||||
(cond
|
(cond
|
||||||
|
|
Loading…
Add table
Reference in a new issue