Commit graph

122 commits

Author SHA1 Message Date
Jack Kamm
f96558004e Always prefer text to html for ob-ein output 2018-11-22 11:23:22 -08:00
Sam Steingold
25f2f49943 use cl-defmethod instead of defmethod
defmethod macro is obsolete.
it expands to a defun eieio-defmethod which cannot use cl-call-next-method
2018-11-08 16:24:28 -05:00
Sam Steingold
1c6270c425 update the code base to avoid compilation warnings about obsolete functions
call-next-method -> cl-call-next-method
set-slot-value -> (setf slot-value)
*-child-p -> cl-typep
oref <keyword> -> slot-value <symbol>
object-p -> eieio-object-p
Closes https://github.com/millejoh/emacs-ipython-notebook/issues/394
2018-11-08 09:36:35 -05:00
Sam Steingold
d3a1bf829b use substitute-command-keys instead of hard-coding keys in help 2018-11-07 09:17:04 -05:00
dickmao
11c2245c41 Asynchronize all server communication
Use deferred and callbacks instead of `:sync t` for tkf requests which
is known to have issues.  Query server attributes once on
notebooklist-open to avoid sequencing issue #176 (but allow Resync).
Under curl backend, a second request for the same "key" as a pending
request will abort the latter, which has resulted in a clobbered
curl-cookie-jar file, so merely warn and don't abort.

Fix #176
2018-10-07 00:40:48 -04:00
dickmao
ad8408dfb7 Implement undo
`M-x customize-group RET ein`
Toggle `Ein:Worksheet Enable Undo`
Save for Future Sessions
Restart emacs or kill/restart notebook

Fixes #338
2018-10-02 10:00:25 -04:00
dickmao
ec28cbe708 revive tkf tests
`make test-unit`
`make test-int` (formerly `cask exec ert-runner`)
An intermittent travis-melpa issue is solved by gonewest818.
2018-09-27 00:52:00 -04:00
Sam Steingold
3f970319fe every defcustom must have :type 2018-05-29 17:20:31 -04:00
John Miller
9ad9b4f4e6 Hooks to customize behavior during kernel execution.
New hooks `ein:pre-kernel-execute-functions', `ein:on-execute-reply-functions'
and `ein:on-shell-reply-functions'. See variable documentation for more
information.
2018-05-12 17:32:32 -05:00
John Miller
5f0921ea96
Merge pull request #302 from nealsid/master
Add overlay to output area with new faces.
2018-05-12 07:39:16 -05:00
Neal
56e72c11d3 Add overlay to output area with new faces.
Similar to having an input area face, we now have faces for errors &
normal output in the output area. They're currently empty to preserve
existing appearance.
2018-05-11 23:24:33 -06:00
Jared Flatow
229303a45c dont fail on image insertion failure, just warn 2018-05-11 15:34:11 -07:00
John Miller
fcf9bff0af ein-cell: Bugfix to keep everything from turning into hy cells.
Fix bug that was turning all the cells in a notebook without the ein.hycell
metadata tag present into hy-codecells.
2018-04-14 20:38:22 -05:00
John Miller
847f7ca5a1 Prepare for v0.14, properly save and load hy codecells. 2018-04-14 13:29:16 -05:00
John Miller
115c16eb9f ein-hy: Support executing hy code from notebook running a python kernel.
It's magic! If you have hy installed in your environment, you can run code in a
notebook running a python kernel. Just set the cell type to hy-code!
2018-03-11 12:29:54 -05:00
John Miller
4ce1a31793 ein-cell: Fix for #268.
User can now ask ein to truncate long outputs in a worksheet. Use the
customizable variable `ein:truncate-long-cell-output' to control this behavior.
Set to nil to have no truncation, otherwise an integer value specifying the
number of lines to keep before truncating.
2018-03-08 13:36:09 -06:00
John Miller
7569ab3f19 ein-cell: Maybe fix #264
This seems to fix the formatting issue reported in issue #264. So far the change
has not caused notebook data to become corrupted.
2018-01-24 17:01:48 -06:00
John Miller
c5421b090f More eieio warning cleanup. 2017-11-04 11:27:06 -05:00
John Miller
d201dfadc4 Doc, dependency updates. Tweaks for Emacs 24 compatibility. 2017-07-30 11:37:44 -05:00
John Miller
4419818dde Merge branch 'back-to-eieio' 2017-07-29 23:08:35 -05:00
John Miller
c78711a7c4 Back to eieio
It seems there are enough people out there still on Emacs 24 to warrant undoing
some of my recent moves away from eieio to cl-generic. For the near future I
will try to keep any changes that are incompatible with Emacs 24 to a
development branch. There is still probably plenty of opportunity to make the
code more future-proof for an eventual move away from eieio (I'm looking at you
oref and sref...)
2017-07-12 14:38:04 -05:00
John Miller
aebdbc1eb8 ein-cell: Fix saving images in worksheets.
Images weren't being save to json in the way they should have. Mostly had to do
with how the attirbutes were being ordered. This is still, unfortunately, a
nasty bit code but it still seems to work.
2017-06-30 21:41:16 -05:00
John Miller
778d58b850 Reintroduce ein-skewer.el
The code was lost, but now it is found.
2017-06-12 11:05:24 -05:00
John Miller
9cfb25379e Merge branch 'master' into dynamic-javascript 2017-06-11 20:30:09 -05:00
John Miller
179cec48ae ein-cell: Fix slideshow metadata.
Was using wrong name for slide type; should be 'slide_type' not 'slide-type'.
2017-06-02 15:05:21 -05:00
John Miller
1bbaf7600c Merge branch 'master' into dynamic-javascript 2017-05-30 21:00:26 -05:00
John Miller
3697273a84 slideshow: Clean up variable names (no more underscores). 2017-05-22 08:02:42 -05:00
Dov Grobgeld
6b752fd32b Update ein-cell.el
Fixed typo.
2017-05-18 22:22:40 +03:00
John Miller
c97c85eae8 ein-cell-output: Remove duplicate code. 2017-05-18 10:17:10 -05:00
John Miller
d9c77492d6 Balancing parenthesis. 2017-05-16 15:07:14 -05:00
John Miller
4f4cfa8f0a Ensure new cells have metadata set. 2017-05-16 14:34:40 -05:00
John Miller
43a1afe49b Preserve metadata information when saving.
EIN should now respect when other actors (namely nbextensions) set metadata for
a cell.
2017-05-16 13:55:43 -05:00
John Miller
e88f7f3d5f Fix for #188.
Make even more unique edit-cell buffer names. Check that an edit-cell-buffer
does not already exits before creating one.

Also try to be even more aggressive in limiting output in backtraces when
debugging ein.
2017-04-02 08:59:02 -05:00
Thierry BM
740c1ca999 Fix for the copy cell feature 2017-02-23 19:14:01 -05:00
John Miller
0ede9e7ef6 Typos in slot name accessors, fix version cache to accept URL strings.
Mistyped some accessors for worksheet slot accessors. Correct
`*running-ipython-version*` hash to accept strings (i.e. URL's) as well as just
port numbers.
2017-02-01 09:51:12 -06:00
John Miller
cfd0e8a3d7 Fix clear_output in the Jupyter age and a bug fix.
Finally do the right thing when clear_output is received. Closes issue #24. Also
fix a nasty bug that might occurr when trying to open a notebook with no
associated kernelspec.
2016-12-23 16:33:35 -06:00
Sam Steingold
fa18077e28 bind goal-column to nil around ewoc-goto-node to fix issue#146 2016-12-18 13:10:25 -05:00
John Miller
d85717bd24 Ensure inserted images are non-whitespace characters.
This is intended to fix #149.
2016-12-14 13:02:21 -06: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
f07b5ad7f0 execute_result is the new pyout
Caught one! "pyout" messages are now called "execute_result", so we
should act accordingly. Before "execute_result" was being treated as
"display_data".
2016-09-30 13:26:54 -05:00
John Miller
812757fcc3 Revert "Basic javascript support via skewer.el"
This reverts commit 9e39797ce7.
2016-09-03 18:10:07 -05:00
John Miller
9e39797ce7 Basic javascript support via skewer.el
EIN will try to use skewer to execute javascript cells, which works for
the most part. Those hoping to have widgest or something like d3 working
are going to be disappointed, however, as at its heart ein is not an
HTML page and those packages depend on modifying the DOM of the notebook
web page.

It remains to be seen if those issues are surmountable, but for the
moment this functionality will live in this branch and this branch
alone.
2016-09-03 18:01:57 -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
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
62c0c21d28
cleaning some debug messages 2016-07-19 10:46:50 +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
43471c771d Better pretty printing defaults.
Make text output the last option when pretty printing is enabled
(eg when ein:output-type-preference is set to
ein:output-type-prefer-pretty-text-over-html). This will at least make
%%latex cells output the latex inside. Next step - automatically typeset
the math!
2016-04-15 13:16:05 -05:00
John Miller
3aa290ed91 Fix breadcrumbs in notebook list.
Seems like a regression, but I'm not 100% sure on that.

Update metadata name (add ein qualifier) per Jupyter documentation
guidance.
2015-09-14 13:16:49 -05:00
John Miller
efaba65cfe Fixing issue #70
Not sure if this completely address issue raised in #70; will need to confirm what expected behavior should be.
2015-08-26 20:45:09 -05:00