mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
Include scratch sheet in ein:notebook-buffer
Now it is possible to have worksheet buffer closed but scratchsheet buffer opened. In this case, ein:notebook-live-p should return t and ein:notebook-buffer should return the scratchsheet buffer. This is because notebook commands can such as save or rename can be executed from the scratchsheet buffer. ein:notebook-to-json-after-closing-a-worksheet is modified also this test fails without the change in ein:notebook-buffer.
This commit is contained in:
parent
271bb24b3e
commit
b56644d9b6
2 changed files with 6 additions and 2 deletions
|
@ -231,8 +231,11 @@ call notebook destructor `ein:notebook-del'."
|
|||
(defun ein:notebook-buffer (notebook)
|
||||
"Return the buffer that is associated with NOTEBOOK."
|
||||
;; FIXME: Find a better way to define notebook buffer! (or remove this func)
|
||||
(loop for ws in (ein:$notebook-worksheets notebook)
|
||||
if (ein:worksheet-buffer ws) return it))
|
||||
(let ((first-buffer
|
||||
(lambda (ws-list)
|
||||
(loop for ws in ws-list if (ein:worksheet-buffer ws) return it))))
|
||||
(or (funcall first-buffer (ein:$notebook-worksheets notebook))
|
||||
(funcall first-buffer (ein:$notebook-scratchsheets notebook)))))
|
||||
|
||||
(defun ein:notebook-buffer-list (notebook)
|
||||
"Return the buffers associated with NOTEBOOK's kernel.
|
||||
|
|
|
@ -729,6 +729,7 @@ defined."
|
|||
(should-not (ein:notebook-modified-p notebook))
|
||||
;; Kill a worksheet buffer
|
||||
(kill-buffer buffer)
|
||||
(should (ein:notebook-live-p notebook))
|
||||
;; to-json should still work
|
||||
(funcall test notebook))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue