Commit graph

1445 commits

Author SHA1 Message Date
John Miller
807393d311 Update required version of websocket. 2019-10-19 08:53:49 -06:00
John Miller
86c034997e Rework loop to avoid warning about unused lexical variable. 2019-10-12 08:37:46 -05:00
John Miller
940387b17b Use correct add-function syntax with lexical variables. 2019-10-12 08:37:46 -05:00
John Miller
21693f9b08 Clean-up unused lexical variable warnings. 2019-10-12 08:37:46 -05:00
Sam Steingold
448e161068 Avoid dependency on the deprecated package "cl"
Replace `defun*' with `cl-defun', `loop' with `cl-loop',
  `case' with `cl-case', `assert' with `cl-assert',
  `destructuring-bind' with `cl-destructuring-bind',
  `multiple-value-bind' with `cl-multiple-value-bind',
  `equalp` with `cl-equalp`, `defstruct' with `cl-defstruct`
  &c &c &c
Use lexical-binding instead of lexical-let.
Add declarations and defvar to avoid breakage.
2019-10-12 08:37:46 -05:00
Miller
e7815780d5 Include IPython magics in the syntax table.
The % character should be part of the symbol, just as _ as . are.
2019-10-06 18:05:36 -05:00
Miller
58db03836c company-backends is a buffer-local variable
We have to be careful about setting it globally because that seems to be causing
some conflicts, better to set it at the buffer level when we are opening a
notebook otherwise ein:company-backend may not be activated.
2019-10-06 18:05:36 -05:00
Miller
d3591e011a Improvements to company backend.
- Make sure we only cache actual python objects.
- Do better when we are completing in the middle of an object.

To that end is the new function `ein:object-prefix-at-point' that returns the
prefix for the dotty.thing.at.point. See the function documentation for more
info.
2019-10-06 18:05:36 -05:00
John Miller
ef92e574b2 Support julia in multilang.
Doesn't break travis, but it is causing problems in my local linux setup.
2019-10-05 22:15:39 -05:00
dickmao
b3179a12d1 ein:notebooklist cannot see ein:jupyter-default-server-command on startup.
move default-kernel defcustom to ein:jupyter
2019-09-30 18:36:01 -04:00
dickmao
ed4522b787 ob-lang cannot require org
Generally, ob-lang modules cannot require org, else it gets into
infinite require loop.

This begs the question whether ob-ein is really used by anyone.
2019-09-29 17:16:25 -04:00
dickmao
507eaf4d9a fix NPE in poly-ein (revealed in ESS) 2019-09-29 12:19:46 -04:00
dickmao
189b89fb6c give purcell/nix-emacs-ci a spin 2019-09-29 12:19:36 -04:00
dickmao
e4e04fdc3d Specifying default kernel
```
M-x customize-group RET ein
Select Ein:Notebooklist-Default-Kernel
```

Closes #82
2019-09-29 12:19:10 -04:00
dickmao
61238485e0 Closes #580 2019-08-13 08:04:47 -04:00
dickmao
2ca536fdec add org-export test 2019-08-10 21:16:51 -04:00
dickmao
101a04acc8 the failures happen often enough we should not split the screen. 2019-08-07 17:06:56 -04:00
dickmao
d6d97d135c Shutting down
On my linux machine and travis, I'm noticing the undocumented
`api/shutdown` does not reliably kill the server.

I tried my best with appveyor but couldn't coerce it back to the
working state 13 days ago.
2019-08-07 17:01:11 -04:00
John Miller
ce419a12a5
Appveyor iterating (WIP) (#573)
* ob-ein: Bring back old functionality.

Bring back some old features to babel edit buffers while trying to respect
recent addition of polymode support.

* Override polymode if the user really wants.

Polymode is really for notebook buffers in any case, but this will override
whatever completion backmode a user has configured for python-mode.

* Install cask using python2.

For now python2 is the easiest option for testing on Windows since cask does
not properly support python3 when in Windows.

* Let's throw in the ert-runner, see what happens.

* Can I use my fork of cask?

Work around smartrep weirdness, try to live without command line wildcard
expansion.

* Get the url for the fork right.

* Experiment with python37, use test_script.

* Unstick appveyor, I hope.

* Fix parsing error.

* test_script is not executing. Why?

* Add ert testing.

But why are the test_script commands not executing?

* tasks: Automate building and testing using invoke.

Invoke leverages Python, which I hope will allow us to abstract out differences
in platforms when it comes to building and testing ein.

* Use invoke on appveyor.

* appveyor: Use the environment python.

So we can test versions other than python 2.7.

* Parsing error.

Is
https://packaging.python.org/guides/supporting-windows-using-appveyor/#setting-up
lying to me?

* Quote commands, just in case.

* Get python onto the path.

* Appveyor is catching up to travis.

* Parsing error.

* Update pip, try to get quoted syntax right.

* Still not liking my pip call.

Last try, next step we go to a requirements.txt file.

* Go to using a requirements file for pip.

* ecukes needs bash to work.

* Cleaning up and fiddling.

Seems like the emacs-jupyter guy has his act together - maybe we can take some
inspiration for our appveyor config.

* Syntax error in environment.

* More syntax errros.

* Maybe we need quoting.

* I give up.

* Formatting and cleanup.

* Add customization, yet another syntax error.

New customizable variable `ob-ein-babel-edit-polymode-ignore' to override
keybinding for \C-c\C-c in an org source code edit buffer.

* John learned some Powershell today.

* Fix the executable path.

Sometimes there is more than one curl installed on the system, make sure we can
account for that in testing.

* Handle updating the path inside invoke.

* Report which curl we are using before starting functional tests.

* Enable RDP so we can see error logs.

* Keep the build alive even when it finishes.

* Fix #568.

Apparently we need to specify the user agent when on windows, otherwise tornado
will start throwing 403 responses. Currently using Mozilla/4.0 as the agent, but
might be a good idea to make this value customizable.

* Clean up emacs config.

* Why is appveyor dropping the xsrf token?

* xsrf cookie found, what does the header look like?

* Try different user-agent header, reenable rdp.

* JSON encoding issues on Python side, it appears. Let's try an older Python.

Login works, contents query to get notebooklist works (i.e. GET on
/contents/api), but creating a notebook (i.e. POST on /contents/api) fails with
invalid JSON. ein and emacs-request appear to be generating the proper json, but
jupyter notebook does not see the same thing that is being written. Could be
bytes vs. text issue with modern v3.x python, so let us see how this all works
with Python 2.7.

* Python27 does not have pathlib out of the box.

* Make amends with Python27

* Back to python37.

Tornado/notebook still isn't reading the POST'ed json correctly.

* Do we need to specify content type?

* Must be selective in specifying application/json content.

* Re-enable rdp.

* Let's try a different curl.

* Ensure most recent curl is on path

* Try a different path.

* Try to warn user if suspicious curl detected.

* Remove debugging statements.

* EVM depends on trusty for 26.x

See issue #125 (https://github.com/rejeep/evm/issues/125). Let's hope I got the
travis.yml syntax right.

* Minimal support for ecukes from invoke.

* Cleaner server shutdowns, better ecukes support from invoke.

Use the /api/shutdown REST API call now to shutdown running server. Also support
more command line options for ecukes from invoke.

* Almost full support of ecukes using invoke.

But! Also disabling integration testing for the time being until I understand
why ecukes fails even though everything else is working.

* Just do integration and functional testing on appveyor.

Better than nothing while I work out what is breaking the integration tests.
2019-07-28 18:20:13 -06:00
dickmao
452d0e01b4 tkf/emacs-request 0.3.1 defaults encoding to utf-8
ein seems to have preferred the old default encoding of `binary` versus
`utf-8`.  Explicity set encoding back to `binary` but this
necessitates our using the latest emacs-request.

Fixes #566
2019-07-02 00:12:52 -04:00
John Miller
4e7d56a7d9
Document and dependency updates. (#561)
* Documentation chasing the commit tail.

* This really belongs with the project.

No longer 100% up to date, but worth including if nothing more than for
historical purposes.

* Update ob-ein documentation.

* Fix testing for emacs 27.

Shouldn't setq a structure accessor.

* Add the changelog.

* Workaround for issue #559.

Force ein to use an earlier version (0.9) of websocket.

* Update to v0.16.1

* Add changelog.

One of these days I will remember.

* Get my links right.

* Revert now that websocket is working again.

* Doc updates, dependency updates, prepare for another release.

Make sure we point to a working version of websocket. Documenting some changes
so we can release v0.16.2.

* Make sure we get all the documentation changes in.

* Latest IPython version is 7.5.

Update travis accordingly.
2019-06-22 10:01:50 -05:00
Sam Steingold
7cb4f91f7e fix#560: request-response-status-code may return nil 2019-06-21 09:39:03 -04:00
dickmao
1bdb5b0651 Polymode bugfixes
Because global-font-lock-mode will call font-lock-initial-fontify, the
inconsistency caused by nullifying font-lock-function while preserving
font-lock-fontify-buffer-function causes the whole buffer to get
fontified in polymode

Commit a969736 duplicated the before-until advice on
syntax-propertize.  This broke polymode badly, and yet none of my
tests catch this (partly because it's hard to test font-lock).
2019-06-10 19:10:55 -04:00
dickmao
3f6e507857 Do not assume "notebook" subcommand
Some users run jupyter via `jupyter-notebook` instead of `jupyter`,
and break because we unilaterally impose the "notebook" subcommand.

Those users can now:
```
M-x customize-group ein
Jupyter Server Use Subcommand: Omit
```
2019-06-05 14:30:26 -04:00
John Miller
88a52f52ea Eldoc support should only show the function signature.
Returning the entire help string can be distracting as the minibuffers expands
to try to fit everything on string. The point of eldoc is to help with function
signature.
2019-06-01 09:51:19 -05:00
John Miller
609abd9a5e ein-cell-edit: Restore window configuration after exiting edit buffer.
Fixes #547.
2019-06-01 09:35:50 -05:00
John Miller
fb85743ce6
Merge pull request #548 from fedeinthemix/wip-fix-completion
ein:kernel-complete: use ':code' instead of ':line' for api-version 4.
2019-05-31 20:18:27 -05:00
John Miller
b0c46383cc
Merge pull request #545 from fedeinthemix/normalize-kernel-names
Normalize the kernelspec language string.
2019-05-31 18:09:47 -05:00
dickmao
dcea37d02e Forestall Polymode "Contamination"
`advice.el` suggests the `ad-default-compilation-action=maybe` admits
inadvertent byte-compilation of advised syntax-ppss in non-EIN
packages reported in #537.

Prevent this by setting `ad-default-compilation-action=never`
when ein:polymode is activated.
2019-05-29 18:56:57 -04:00
Federico Beffa
1cab86995a ein:kernel-complete: use ':code' instead of ':line' for api-version 4. 2019-05-29 18:34:09 +02:00
Federico Beffa
9b7b88c5d4 Normalize kernel language name: Don't change case. 2019-05-29 17:02:16 +02:00
Federico Beffa
f0c9812c5a Normalize the kernelspec language string. 2019-05-27 16:24:47 +02:00
dickmao
a969736a03 gate the add-functions in ein:polymode 2019-05-26 00:28:23 -04:00
John Miller
8a6b8aade1
Merge pull request #541 from millejoh/issue-523
Issue 523
2019-05-25 16:39:35 -05:00
dickmao
ceda628f92 Standardize metadata a bit 2019-05-25 11:31:05 -04:00
John Miller
fe3430102c Add documentation, work around smartrep.
I am starting to get annoyed by smartrep...
2019-05-25 10:23:22 -05:00
dickmao
f79a211c6c The only thing necessary for the triumph of evil...
Protect against undo-tree-mode both now and in the future.
2019-05-24 16:39:06 -04:00
Miller
321d0e6c15 ein-notebook: Command to jump to an open notebook buffer.
Per issue #523, add a command that let's user select and switch to an open
notebook buffer.
2019-05-24 14:15:36 -05:00
dickmao
c7b8b4cb27 ob-ein bugfix
Currently, an org block that has no output (e.g., `foo = 5`) never
clears the `[....]` upon block completion.

Also, no `:session` should default to localhost.
2019-05-21 19:24:24 -04:00
dickmao
e491ac6f1c Ob-ein Improvements
Bring the org offering to feature parity.
2019-05-20 10:59:43 -04:00
dickmao
6e53d8f1a8 futz with undo.ipynb 2019-05-16 10:15:11 -04:00
dickmao
8738fa5e0a If you see something, say something
Avoid silently failing as in #530 where kernelspec language is unrecognized.
2019-05-16 09:47:24 -04:00
dickmao
dcda68310b half-baked cookie jar messes up websocket 2019-05-07 22:46:37 -04:00
dickmao
f4d301d8c9 Cleanup save-before-quit logic, and polymode kill buffer bugfix
Before: Exit emacs with modified notebooks.  Be asked "You have
unsaved notebooks.  Discard changes?"  Respond no, and manually figure
out which notebooks haven't been saved.

After: Exit emacs with modified notebooks.  Be asked "Save A?".
Respond yes.  Quit without further ado.

Also, bugfix killing of buffers in polymode.  Must kill host buffer,
not indirect buffers.
2019-05-07 09:54:20 -04:00
dickmao
d3b0b97037 pm--get-existing-mode changed signature. 2019-04-29 15:35:32 -04:00
dickmao
1da03d69f6 Stop bug, Image bug
Initial SIGTERM prompts server to dutifully shutdown kernel, but
another SIGTERM necessary to kill server.  Perhaps ipython changed
since the last time I tested this.

Ipython doesn't send a display_data message upon initial plot
request.  This is probably our bug, or is it?  Document this bug in an
ecukes test.

Also enforce emacs version >= 25
2019-04-29 13:15:53 -04:00
John Miller
70845a3411
Use completing-read instead of ido-completing-read. (#514)
* Use completing-read instead of ido-completing-read.

Per @seagle0128 and issue #496.

* lisp/ein-notebook.el:

* Wrap all calls to completing-read with ein:completing-read

Use `ein:completing-read' everywhere we need to do completion as it wraps Emacs
completing-read functionality and tries to use sane defaults.
2019-04-16 10:04:11 -05:00
dickmao
921b3a94e4 need to see websocket output of eldoc call 2019-04-14 14:39:46 -04:00
dickmao
a6641f05cf cl-generic 1.0 is built-in 2019-04-14 12:31:14 -04:00
dickmao
c7ff377a89 cl-generic 0.3 is not going to cut it 2019-04-14 12:15:54 -04:00