Commit graph

152 commits

Author SHA1 Message Date
dickmao
d3b0b97037 pm--get-existing-mode changed signature. 2019-04-29 15:35:32 -04:00
dickmao
539c3339dd Undo did not account for slideshow
C-c C-d breaks undo.  Fix as follows:

Before: turn on slide indicator via C-c S, toggle type with C-c C-d

After: toggle type with C-c S.

Benefits: Fixes undo, simplifies slideshow operation, elpy users are
accustomed to having C-c C-d be "jump to doc"
2019-04-04 05:45:34 -04:00
dickmao
234cf391f9 Polymode
M-x customize-group RET ein
Toggle Ein:Polymode

Avoid trying to emulate jump-to-definition, eldoc, and autocompletion
functionalities that Elpy will always do better.

Fixes #497 #482 #418
2019-04-02 09:35:17 -04:00
Sam Steingold
48fa153435 Use standard functionality instead of ad hoc functions
(ein:filter identity ...) ---> (delete nil ...)
ein:filter --> seq-filter
hash-vals --> hash-table-values
hash-keys --> hash-table-keys
2019-01-15 11:26:09 -05:00
dickmao
9825aa39c0 if C-/ is mapped to anything other than native undo, disable undoing 2019-01-11 08:32:51 -05:00
dickmao
4c60dec927 Disable undo when failure diagnostic triggered 2019-01-07 08:08:11 -05:00
John Miller
624e9549ef
Merge pull request #444 from dickmao/undo-default-true
Enable undo by default
2018-12-29 17:15:06 -06:00
dickmao
58de1294f8 default undo to true 2018-12-28 22:31:23 -05:00
dickmao
129afa5fb4 Respect cursor_start and cursor_end in matches
The :cursor_start and :cursor_end fields tell us whether we need to
prepend the prefix ourselves.

Fixes #436
2018-12-28 21:14:11 -05:00
dickmao
dc48a7e75d Fixes #433 2018-12-13 13:27:27 -05:00
dickmao
bead667ee0 Clean up multilang
Do not assume python... leverage ESS to improve R interaction.
Fix both undo and fontify in the presence of toggling cells (`C-c
C-t`)
Fix and test switching kernels
2018-12-08 21:25:48 -05:00
John Miller
608058e07c ein-worksheet: Fix unhelpful error message.
Be more informative to the user when we cannot find an executing cell in either
`ein:worksheet-jump-to-first-executing-cell' or
`ein:worksheet-jump-to-next-executing-cell'.
2018-12-04 09:25:16 -06:00
John Miller
5e1406b912 ein-worksheet: Jump to executing cell.
Add commands `ein:worksheet-jump-to-first-executing-cell' and
`ein:worksheet-jumpto-next-executing-cell' which do pretty much what they say.
2018-11-27 16:57:41 -06: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
dickmao
84fa177a1e When I C-c C-c also C-c C-r if necessary
If user wants to execute cell, and the connection is down,
automatically reconnect, then execute the cell.
2018-11-06 18:36:46 -05:00
dickmao
d621944797 Clean up websocket callbacks
Coursera appears to kill websockets every minute or so, and I'm
observing firsthand the buggy behaviors described in #356.  This PR
cleans up the websocket code and kernel restart logic.  Removed
backwards compatibility for the v2 messaging api
as keeping it in the presence of the refactoring would make it more
broken that it already was.
2018-10-31 23:38:45 -04:00
John Miller
35f06babc6 ein-worksheet: Fix whitespace, argument list for error call.
Missing an argument for the error format string. Also cleaned up some lingering
whitespace.
2018-10-22 14:45:14 -05: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
Sam Steingold
143267cf06 add ein:worksheet-kernel-status 2018-09-05 09:50:12 -04:00
Tomasz Mieszkowski
c7d77ec2f5 Fix for bumping gc-cons-threshold while opening notebooks
Make `ein:gc-prepare-operation` idempotent and add missing call to
`ein:gc-complete-operation` - without it, each subsequently opened notebook
bumps gc threshold to a higher and higher value, effectively disabling all
garbage collection and seriously degrading overall performance.
2018-08-25 21:10:19 +02:00
John Miller
376f263ea9 Documentation fixes. 2018-04-14 13:53:50 -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
045d9e9a89 Adjustments to debug logging.
Added some verbosity, removed some calls that were causing errors.
2018-02-14 18:24:20 -06:00
John Miller
63388e5d0c ein-worksheet: Make full undo an optional feature.
Full undo support, including undoing cell actions, is still unstable and can
cause corruption of worksheet data so I am making this an optional feature. See
the variable `ein:worksheet-enable-undo', which by default will be set to nil.
2018-01-24 16:35:41 -06:00
John Miller
af13e8cdb1 ein-worksheet: Clean byte-compile warnings. 2017-10-24 12:12:50 -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
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
Charl P. Botha
61ba1e9a30 ein:get-kernel works in edit-cell-mode
Modify ein:get-kernel so it can retrieve the kernel from the local
worksheet variable in edit-cell-mode. This is done so that functions
such as ein:completer-complete and tooltips / inline help are
availeble to be bound by the user.
2017-03-22 12:22:36 +02: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
4e482cafd9 Stop being so clever with error handling. Stepping away from eieio.
Automatically calling ein:notebooklist-login when a content API calls is a BAD
IDEA. Much better to warn and suggest, and if debugging is enabled throw the
error so hopefully a backtrace can be generated.

Taking some initial steps away from eieio and towards cl-generic.
2017-02-01 09:25:47 -06:00
John Miller
ceec3f8feb Fix missing paren in ein-worksheet.el
Paredit, why have you abandoned me?
2017-01-29 11:12:31 -06:00
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