mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-05 09:01:40 -05:00
Add section comments on ein-cell.el
I will need to reorder functions, but it's better than nothing.
This commit is contained in:
parent
62b1ecfb62
commit
7971143d64
1 changed files with 16 additions and 0 deletions
16
ein-cell.el
16
ein-cell.el
|
@ -34,6 +34,8 @@
|
|||
(require 'ein-utils)
|
||||
(require 'ein-node)
|
||||
|
||||
|
||||
;;; EIEIO related utils
|
||||
|
||||
(defmacro ein:oset-if-empty (obj slot value)
|
||||
`(unless (and (slot-boundp ,obj ,slot) (oref ,obj ,slot))
|
||||
|
@ -43,6 +45,8 @@
|
|||
`(when (slot-boundp ,obj ,slot)
|
||||
(oref ,obj ,slot)))
|
||||
|
||||
|
||||
:;; Cell classes
|
||||
|
||||
(defclass ein:basecell ()
|
||||
((cell-type :initarg :cell-type :type string)
|
||||
|
@ -80,6 +84,9 @@
|
|||
(defclass ein:rstcell (ein:textcell)
|
||||
((cell-type :initarg :cell-type :initform "rst")))
|
||||
|
||||
|
||||
;;; Cell factory
|
||||
|
||||
(defun ein:cell-class-from-type (type)
|
||||
(ein:case-equal type
|
||||
(("code") 'ein:codecell)
|
||||
|
@ -107,6 +114,9 @@
|
|||
(oset cell :input it))
|
||||
cell)
|
||||
|
||||
|
||||
;;; Getter/setter
|
||||
|
||||
(defmethod ein:cell-num-outputs ((cell ein:codecell))
|
||||
(length (oref cell :outputs)))
|
||||
|
||||
|
@ -157,6 +167,9 @@ A specific node can be specified using optional ARGS."
|
|||
(append (call-next-method)
|
||||
(ein:cell-element-get cell :output)))
|
||||
|
||||
|
||||
;; EWOC
|
||||
|
||||
(defun ein:cell-make-element (make-node num-outputs)
|
||||
(list
|
||||
:prompt (funcall make-node 'prompt)
|
||||
|
@ -291,6 +304,9 @@ A specific node can be specified using optional ARGS."
|
|||
;; Skip the newline
|
||||
(forward-char))
|
||||
|
||||
|
||||
;; Data manipulation
|
||||
|
||||
(defun ein:cell-clear-output (cell stdout stderr other)
|
||||
;; codecell.js in IPytohn implements it using timeout and callback.
|
||||
;; As it is unclear why timeout is needed, just clear output
|
||||
|
|
Loading…
Add table
Reference in a new issue