mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
Remove ein:notebook-setup
I want initialize notebook before calling ein:notebook-get-buffer.
This commit is contained in:
parent
e8a7ce7a98
commit
b020c0bda6
1 changed files with 4 additions and 8 deletions
|
@ -94,18 +94,12 @@ is `nil', BODY is executed with any cell types."
|
||||||
notebook))
|
notebook))
|
||||||
|
|
||||||
(defun ein:notebook-init (notebook data)
|
(defun ein:notebook-init (notebook data)
|
||||||
"called from `ein:notebook-setup'."
|
"Initialize NOTEBOOK with DATA from the server."
|
||||||
(setf (ein:$notebook-data notebook) data)
|
(setf (ein:$notebook-data notebook) data)
|
||||||
(setf (ein:$notebook-pager notebook)
|
(setf (ein:$notebook-pager notebook)
|
||||||
(ein:pager-new
|
(ein:pager-new
|
||||||
(format "*ein: %s/pager*" (ein:$notebook-notebook-id notebook)))))
|
(format "*ein: %s/pager*" (ein:$notebook-notebook-id notebook)))))
|
||||||
|
|
||||||
(defun ein:notebook-setup (notebook data)
|
|
||||||
"Setup notebook NOTEBOOK for the current buffer."
|
|
||||||
(ein:log-setup (ein:$notebook-notebook-id notebook))
|
|
||||||
(ein:notebook-init notebook data)
|
|
||||||
(setq ein:notebook notebook))
|
|
||||||
|
|
||||||
(defun ein:notebook-get-buffer (notebook)
|
(defun ein:notebook-get-buffer (notebook)
|
||||||
(get-buffer-create
|
(get-buffer-create
|
||||||
(format ein:notebook-buffer-name-template
|
(format ein:notebook-buffer-name-template
|
||||||
|
@ -133,8 +127,10 @@ is `nil', BODY is executed with any cell types."
|
||||||
(let ((data (ein:json-read))
|
(let ((data (ein:json-read))
|
||||||
(notebook-id (ein:$notebook-notebook-id notebook)))
|
(notebook-id (ein:$notebook-notebook-id notebook)))
|
||||||
(kill-buffer (current-buffer))
|
(kill-buffer (current-buffer))
|
||||||
|
(ein:notebook-init notebook data)
|
||||||
(with-current-buffer (ein:notebook-get-buffer notebook)
|
(with-current-buffer (ein:notebook-get-buffer notebook)
|
||||||
(ein:notebook-setup notebook data)
|
(ein:log-setup (ein:$notebook-notebook-id notebook))
|
||||||
|
(setq ein:notebook notebook)
|
||||||
(ein:notebook-render)
|
(ein:notebook-render)
|
||||||
(pop-to-buffer (current-buffer)))))
|
(pop-to-buffer (current-buffer)))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue