Commit graph

167 commits

Author SHA1 Message Date
John Miller
ac2aa7f88e Better live updating in cell editing buffers, less buggy undo
Saving in a cell editing buffer now actually causes the cell in the worksheet to
be dynamically updated (oh how we have waited for this moment).

Try to get cell undo actions to be less likely to trigger an error.
2017-01-28 11:08:26 -06:00
John Miller
06eb2eea2c Cleanup, better error handling, remove request cookie defadvice.
tkf/emacs-request#60 was recently fixed, so no longer need to defadvice
`request--netscape-cookie-parse. Changed names of some obsolete variables. Also
trying to be a bit more clever in error handling by judicious use of
condition-case.
2016-12-22 12:19:52 -06:00
John Miller
45f9b00449 Better macro name, make sure it gets required.
Better name for support macro to temporarily disable undo, add a require to the
code where it is being used.
2016-12-18 22:19:50 -06:00
John Miller
d57c74577f Undo for cell actions: motion, insert, execute.
Some cell actions now have a true undo. Moving, inserting and executing cells
can all be undone. Deleting cell does not have an undo at the moment, though the
preferred method for users is to call ein:worksheet-kill-cell which puts the
removed cell into the kill-ring.
2016-12-16 18:01:06 -06:00
Sam Steingold
2dca181338 bind new_slide_type with let' instead of setting it with setq' 2016-12-05 08:55:48 -05:00
John Miller
87053c7459 Formatting, tweaks to menu and an improved error message.
Adding a couple commands to EIN's menu and an attempt to make cell execution
message more informative.
2016-11-23 12:34:06 -06:00
John Miller
c0144e2cbf Edit notebook cells in popout buffer ala org-mode
Using C-c', users can create a temporary buffer running an appropriate
mode to edit the contents of a notebook cell. This functionality is
intentionally very similar to what org-mode provides for editing blocks
of code or other.
2016-10-25 18:00:51 -05:00
John Miller
55176c3a4c Moving away from eieio to cl-generic
The goal is to eventually eliminate most of the warnings that are
generated when byte-compiling ein.

Do this over several commits to make it easier to revert in the likely
event that something breaks.
2016-10-13 16:29:44 -05:00
John Miller
a9736311c8 Fix what was broken with shared output buffers.
Regression from previous commits adding slide features.
2016-07-25 08:21:50 -05:00
John Miller
04c12f8ab2 Update version, documentation, formatting.
Version bump to 0.9, documentation for new slide functions and
correcting formatting from recent pull requests.
2016-07-23 08:32:22 -05:00
John Miller
67e5253e5e Respect slideshow customization variable
Setting of `ein:worksheet-show-slide-data` wasn't actually doing
anything.
2016-07-22 08:57:11 -05:00
John Miller
3e1baa0657 Toggle viewing of slide metadata in worksheet.
Let the user control whether or not to view slide attributes in current
worksheet via `ein:worksheet-toggle-slideshow-view` (C-c S).

Also added a couple more slide attributes (fragment, notes) as
these appear to be support in current Jupyter version.
2016-07-20 12:50:04 -05:00
Guillaume Anciaux
d7d65f6ac8
fix the default slide and fix a problem at creation of new cells 2016-07-19 17:21:38 +02:00
Guillaume Anciaux
1c549e72d7
addîng the slide info in prompt and allow switch slide type with C-c C-d 2016-07-19 10:37:00 +02:00
John Miller
5886498684 Add worksheet tags to nbformat 4 notebooks
NBformat 4 has a tag key in the cell metadata. We use it to tag a cell
depending on which worksheet it is in. For now the code does nothing
else with this tag, but the goal is to reimplement multiple worksheets
in ein.
2015-05-14 09:39:47 -05:00
millejoh
d52cc9a662 Restore heading level cells to nbformat4 notebooks. 2015-02-15 09:27:18 -06:00
John Miller
849adda708 Support for nbformat v4
BEWARE! This is a large commit and the code here is still mostly
untested. Back up your notebooks before giving this changeset a try with
the current IPython-dev version.

Given that, ein is now able to open and save basic notebooks saved in
nbformat 4. Still haven't tested more complex notebooks with embedded
images.
2014-11-07 19:28:09 -06:00
Takafumi Arakaki
2db2589c78 Document ein:worksheet-beginning/end-of-cell-input bit more 2012-12-07 19:05:34 +01:00
Takafumi Arakaki
4111decfa7 Advice fill-paragraph command to avoid read-only error
fixes #84
2012-11-27 02:54:45 +01:00
Takafumi Arakaki
585739e6b2 Add a command ein:worksheet-dedent-cell-text 2012-10-09 14:02:39 +02:00
Takafumi Arakaki
9162d497f7 Fix ein:worksheet-beginning-of-cell-input when repeating 2012-10-05 15:49:43 +02:00
Takafumi Arakaki
859c96f4df Test (ein:worksheet-end-of-cell-input) and fix it 2012-10-05 14:37:54 +02:00
Takafumi Arakaki
1eb44ad5b3 Test (ein:worksheet-beginning-of-cell-input 2) and fix it 2012-10-05 14:21:00 +02:00
Takafumi Arakaki
b74debf2b7 Test (ein:worksheet-beginning-of-cell-input) and fix it 2012-10-05 14:12:51 +02:00
Takafumi Arakaki
0f8a789826 Fix ein:worksheet-goto-next-cell-element error 2012-10-05 13:12:13 +02:00
Takafumi Arakaki
92971fbc42 Add ein:worksheet-beginning/end-of-cell-input 2012-10-05 13:00:07 +02:00
Takafumi Arakaki
c91ac20493 Add NTH option to ein:worksheet-next-input-cell 2012-10-05 12:41:11 +02:00
Takafumi Arakaki
9630f8f82a Add ein:org-src-back-to-prev-node 2012-09-04 14:16:47 +02:00
Takafumi Arakaki
6e24c989de Add new function ein:worksheet-next-input-cell 2012-09-04 01:56:38 +02:00
Takafumi Arakaki
0373abd2c1 Fix: worksheet could not be renamed to the name in use 2012-09-02 01:47:41 +02:00
Takafumi Arakaki
d07ec3a7d9 Add a command to rename worksheet name 2012-09-02 01:27:40 +02:00
Takafumi Arakaki
13f372b3d8 Deactivate cached cells in ein:worksheet-save-cells
The test ein:notebook-to-json-after-closing-a-worksheet passes at this
point.
2012-08-30 16:51:33 +02:00
Takafumi Arakaki
80f210d346 Remove unused ein:worksheet-detach-from-buffer 2012-08-30 16:26:05 +02:00
Takafumi Arakaki
3313f97325 Add :dont-save-cells slot 2012-08-30 16:18:56 +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
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
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
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
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
b559cca042 Document `:saved-cells' slot 2012-08-29 21:03:18 +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
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