Commit graph

1396 commits

Author SHA1 Message Date
Takafumi Arakaki
80f210d346 Remove unused ein:worksheet-detach-from-buffer 2012-08-30 16:26:05 +02:00
Takafumi Arakaki
d0a16798f4 Set :dont-save-cells instead of detaching buffer
Detaching buffer caused problem in the command
ein:notebook-kill-kernel-then-close-command
because after detaching buffer ein:notebook-close
does not work.

The test ein:notebook-to-json-after-closing-a-worksheet fails at this
point.
2012-08-30 16:23:14 +02:00
Takafumi Arakaki
3313f97325 Add :dont-save-cells slot 2012-08-30 16:18:56 +02:00
Takafumi Arakaki
841ec71e41 Merge branch 'create-worksheet-command'
Add a few commands to make/delete worksheet.  Although they are not
well tested, they seem to work OK.
2012-08-30 03:59:47 +02:00
Takafumi Arakaki
2a9a4e07ca Tweak ein:notebook-worksheet-open-next* commands 2012-08-30 03:57:18 +02:00
Takafumi Arakaki
df9cf20736 Document ein:notebook-worksheet-open-next* commands 2012-08-30 03:49:11 +02:00
Takafumi Arakaki
85c00a8509 Fix error message 2012-08-30 03:37:17 +02:00
Takafumi Arakaki
07198049b8 Add more variants for open command 2012-08-30 03:22:31 +02:00
Takafumi Arakaki
15cf3b1cc9 Add commands to create/delete worksheet 2012-08-30 03:22:31 +02:00
Takafumi Arakaki
94967849f6 Rename to ein:notebook-scratchsheet-render-new
s/ein:notebook-scratchsheet-new/ein:notebook-scratchsheet-render-new/
2012-08-30 03:22:31 +02:00
Takafumi Arakaki
9197238e61 Add ein:notebook-worksheet-render-new 2012-08-30 03:22:31 +02:00
Takafumi Arakaki
ebf933f42f Merge branch 'notebook-to-json-after-discarding-a-worksheet'
Fix two bugs in saving notebook.

1. When discarding a worksheet cells in the buffer should not be
   cached, so that saving the notebook afterward will note save
   the discarded data.

2. After saving a notebook, saved data should be cached so that
   discarding a worksheet and saving the notebook will save the
   data saved before.
2012-08-30 03:15:01 +02:00
Takafumi Arakaki
4a381098ac Deactivate cells when discarding worksheet 2012-08-30 03:07:21 +02:00
Takafumi Arakaki
a692185740 Set current buffer in ein:worksheet-save-cells 2012-08-30 03:07:20 +02:00
Takafumi Arakaki
92c0a4efdf Comment on ein:notebook-save-notebook-success 2012-08-30 03:07:16 +02:00
Takafumi Arakaki
473a16a0a7 Save cells in ein:notebook-save-notebook-success 2012-08-30 02:42:49 +02:00
Takafumi Arakaki
d25f6a1c02 Treat discarding case better in ein:notebook-ask-before-kill-buffer
Note that the test ein:notebook-to-json-after-closing-a-worksheet
fails now.
2012-08-30 02:34:25 +02:00
Takafumi Arakaki
2c8b8cce31 Add a failing test for notebook-to-json 2012-08-30 01:47:43 +02:00
Takafumi Arakaki
e32991a091 Merge branch 'worksheet-to-json-metadata'
Fixed: "metadata: null" was saved
2012-08-30 01:42:11 +02:00
Takafumi Arakaki
1674fcbc3e Add test for ein:worksheet-to-json with metadata 2012-08-30 00:39:19 +02:00
Takafumi Arakaki
0bf9cce4b7 Fix ein:worksheet-to-json
When there is no metadata, do not include it in JSON data to avoid
converting nil to JSON (which yields null).
2012-08-30 00:36:44 +02:00
Takafumi Arakaki
f1f94d772d Fix ein:testing-worksheet-to-json
The argument was not used.
2012-08-30 00:30:31 +02:00
Takafumi Arakaki
e34c6390e0 Include metadata in ein:worksheet-to-json 2012-08-29 21:34:18 +02:00
Takafumi Arakaki
1f301973c8 Set buffer in ein:worksheet-to-json 2012-08-29 21:32:06 +02:00
Takafumi Arakaki
795b27ddd8 Merge branch 'make-cells-in-worksheet-from-json'
* Cache cell instances instead of data sent from server.
  This way, to-json works smoothly as I don't need to implement
  plist to alist conversion.

* As a result, theoretically EIN can open notebook with multiple
  worksheets now, although it can edit only the first worksheet.

* Worksheet buffer can be closed (provided it is not modified)
  while notebook is still open.
2012-08-29 21:11:58 +02:00
Takafumi Arakaki
b56644d9b6 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.
2012-08-29 21:04:24 +02:00
Takafumi Arakaki
271bb24b3e Naming fix on ein:testing-notebook-close-scratchsheet-open-and-close
s/ws-list/ss-list/g
2012-08-29 21:04:23 +02:00
Takafumi Arakaki
135ab1969b Fix failing tests for ein:notebook-close-worksheet
Actually the tests was wrong.  But as it should work if I test it
against scratch sheet instead of worksheet, I modified it to do so.
2012-08-29 21:04:21 +02:00
Takafumi Arakaki
1f8f7dd8c8 Fix ein:notebook-close-worksheet
What ein:notebook-close-worksheet did was horribly wrong.
It deleted a worksheet.  Instead, now it properly close worksheet.

The failing test added in the previous commit passes now
(ein:notebook-to-json-after-closing-a-worksheet).
2012-08-29 21:04:03 +02:00
Takafumi Arakaki
6c6fa65ec6 Add a failing test for ein:notebook-to-json 2012-08-29 21:03:27 +02:00
Takafumi Arakaki
b559cca042 Document `:saved-cells' slot 2012-08-29 21:03:18 +02:00
Takafumi Arakaki
5699ff84e1 Add tests for `:saved-cells' slot 2012-08-29 21:03:17 +02:00
Takafumi Arakaki
42b6363ca5 Support deactivated cell in ein:cell-get-text
This is needed for ein:cell-to-json to work with deactivated cell.
2012-08-29 21:03:14 +02:00
Takafumi Arakaki
95bd5aa950 Support saved-cells in ein:worksheet-get-cells
So ein:worksheet-to-json should work with worksheets without buffer.
2012-08-29 14:12:56 +02:00
Takafumi Arakaki
88f4e488f9 Set metadata in ein:worksheet-from-json
Note that metadata slow was not set elsewhere before.
2012-08-29 14:06:18 +02:00
Takafumi Arakaki
e03f8861b6 Make cells in ein:worksheet-from-json
This is needed to make ein:worksheet-to-json work with un-rendered
worksheets.
2012-08-29 14:05:17 +02:00
Takafumi Arakaki
fb0ea65943 Add a note on ein:notebook--worksheet-render 2012-08-28 22:42:14 +02:00
Takafumi Arakaki
6cbe7e24df Merge branch 'remove-notebook-slot-from-worksheet'
Complex backward dependency on notebook module in worksheet module
is removed.  ein:worksheet class depends on ein:notebook through
simple callbacks.

* There is no object holding notification instance in a slot.
  Worksheet is loosely coupled with notification via buffer
  and events handler.

*  ein:notebook-discard-output-on-save is obsolete now.
2012-08-28 22:03:39 +02:00
Takafumi Arakaki
e3f15e649c Simplify notification module setup 2012-08-28 21:48:06 +02:00
Takafumi Arakaki
3d76a1a225 Remove notification slot from ein:worksheet
What notification module needs to know is its buffer and the events
handler.  So there is no reason to keep it in the worksheet slot.
Besides, setting header-line-format before calling notebook-mode
is not good because setting major mode discards header-line-format.
So, notification is setup in notebook module now.
2012-08-28 21:43:57 +02:00
Takafumi Arakaki
cf30b4f74e Make ein:notebook-discard-output-on-save obsolete 2012-08-28 21:17:49 +02:00
Takafumi Arakaki
cbe1ab3904 Add discard-output-p slot in ein:worksheet 2012-08-28 20:51:18 +02:00
Takafumi Arakaki
848771a724 Remove two more notebook functions from ein-notebook.el 2012-08-28 18:12:51 +02:00
Takafumi Arakaki
7f0f5ea382 Remove ein:$notebook-url-or-port from ein-worksheet.el 2012-08-28 18:03:41 +02:00
Takafumi Arakaki
e93801f101 Add get-notebook-name slot in ein:worksheet 2012-08-28 18:00:32 +02:00
Takafumi Arakaki
1bf5bfd0da Set nbformat in scratchsheet also 2012-08-28 18:00:31 +02:00
Takafumi Arakaki
380d5504f1 Add nbformat slot in ein:worksheet
So that I can remove the line:
(declare-function ein:$notebook-nbformat "ein-notebook")
2012-08-28 18:00:29 +02:00
Takafumi Arakaki
6f7a29fb2f Add notes on Event vs hook vs callback 2012-08-28 17:18:39 +02:00
Takafumi Arakaki
8ac7c83ebc Fix compile warning in ein-kernelinfo.el 2012-08-28 17:15:03 +02:00
Takafumi Arakaki
82ef2fb6be Merge branch 'worksheet-enable-undo'
Rename ein:notebook-enable-undo to ein:worksheet-enable-undo as
worksheet module handles buffer and thus undo now.
2012-08-28 17:04:44 +02:00