Show execution count on header line

This commit is contained in:
Takafumi Arakaki 2012-10-09 20:24:17 +02:00
parent 28ba5e9ad1
commit eb6d0ced49

View file

@ -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