From b020c0bda6d1d481f0a2e36849152dc7ee55c3f3 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 13 May 2012 04:19:22 +0200 Subject: [PATCH] Remove ein:notebook-setup I want initialize notebook before calling ein:notebook-get-buffer. --- ein-notebook.el | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ein-notebook.el b/ein-notebook.el index 9f31e5d..44ea061 100644 --- a/ein-notebook.el +++ b/ein-notebook.el @@ -94,18 +94,12 @@ is `nil', BODY is executed with any cell types." notebook)) (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-pager notebook) (ein:pager-new (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) (get-buffer-create (format ein:notebook-buffer-name-template @@ -133,8 +127,10 @@ is `nil', BODY is executed with any cell types." (let ((data (ein:json-read)) (notebook-id (ein:$notebook-notebook-id notebook))) (kill-buffer (current-buffer)) + (ein:notebook-init notebook data) (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) (pop-to-buffer (current-buffer)))))