mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-05 09:01:40 -05:00
Show execution count on header line
This commit is contained in:
parent
28ba5e9ad1
commit
eb6d0ced49
1 changed files with 12 additions and 1 deletions
|
@ -55,6 +55,9 @@
|
|||
(defclass ein:notification ()
|
||||
((buffer :initarg :buffer :type buffer :document "Notebook buffer")
|
||||
(tab :initarg :tab :type ein:notification-tab)
|
||||
(execution-count
|
||||
:initform "y" :initarg :execution-count
|
||||
:documentation "Last `execution_count' sent by `execute_reply'.")
|
||||
(notebook
|
||||
:initarg :notebook
|
||||
:initform
|
||||
|
@ -103,6 +106,10 @@ where NS is `:kernel' or `:notebook' slot of NOTIFICATION."
|
|||
"Notebook is saved"
|
||||
'notebook_saved.Notebook
|
||||
nil))
|
||||
(ein:events-on events
|
||||
'execution_count.Kernel
|
||||
#'ein:notification--set-execution-count
|
||||
notification)
|
||||
(ein:events-on events
|
||||
'status_restarting.Kernel
|
||||
#'ein:notification--fadeout-callback
|
||||
|
@ -116,6 +123,9 @@ where NS is `:kernel' or `:notebook' slot of NOTIFICATION."
|
|||
(status (cdr packed)))
|
||||
(ein:notification-status-set ns status)))
|
||||
|
||||
(defun ein:notification--set-execution-count (notification count)
|
||||
(oset notification :execution-count count))
|
||||
|
||||
(defun ein:notification--fadeout-callback (packed data)
|
||||
;; FIXME: I can simplify this.
|
||||
;; Do not pass around message, for exmaple.
|
||||
|
@ -193,7 +203,8 @@ worksheet given as its argument."
|
|||
|
||||
(defun ein:header-line ()
|
||||
(format
|
||||
"IP[y]: %s"
|
||||
"IP[%s]: %s"
|
||||
(oref ein:%notification% :execution-count)
|
||||
(ein:join-str
|
||||
" | "
|
||||
(ein:filter
|
||||
|
|
Loading…
Add table
Reference in a new issue