Commit graph

773 commits

Author SHA1 Message Date
Nathaniel Nicandro
c7ec4613be jupyter-repl-insert-banner: Use font-lock-fontified to avoid syntactic fontification 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
e06e61e9fd jupyter-messages.el: Small documentation changes 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
799c9ea2aa jupyter-repl-eval-string: Add stream and error handlers 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
3bfa393596 jupyter-repl-eval-string: Allow a custom callback when evaluating results 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
f6698d8bc1 Add convenience macro jupyter-repl-with-output-buffer 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
948fa6adfc Rename jupyter-with-doc-buffer to jupyter-repl-with-doc-buffer
Also rename `jupyter-get-doc-buffer` to `jupyter-repl-get-special-buffer`
2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
e43c6597ad Add convenience macros for working with messages 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
4374d9dd2c jupyter-repl-eval-string: Don't store history when evaluating silently
We still want to display the results so we can't pass the
silent key to the kernel.
2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
56a90717a1 Add jupyter-repl-display-traceback 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
ed8603f845 jupyter-completion-prefix: Remove type specifier
This is not needed and it seems to create issues when the
method is called without arguments.
2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
6dc9f0cc89 run-jupyter-repl, connect-jupyter-repl: Allow specifying a new REPL name with a prefix argument 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
f0c5f002c4 jupyter-repl-propagate-client: Propagate clients regardless of the current-buffer 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
4a7e95eb18 jupyter-repl-available-repl-buffers: Refactor
Also give an option to return the first found REPL buffer
that can be used for a major mode.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
6c836bd3d8 jupyter-completion-symbol-beginning: Allow operator completions 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
7d824f4915 Add new :input-request message type
This replaces the behavior of the `:input-reply` message
type. A kernel sends an `:input-request` to the frontend
and the client sends an `:input-reply`.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
84fce2cd08 Silence byte compiler about undefined variables 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
e4b820d07c jupyter-repl-eval-string: Pass the silent argument to jupyter-send-execute-request 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
0afa562a5e jupyter-repl-insert-html: Remove javascript tags
`shr` does not handle javascript so there is no point in
keeping it. It also slows down `libxml-parse-html-region`.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
03769a9b01 Don't test for certain html tags 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
1705c48167 Add jupyter-repl-persistent-mode
Instead of advising `switch-to-buffer` whenever
`jupyter-repl` is required, introduce the global minor mode
which attempts to handle all different scenarios where you
would like to propagate the `jupyter-current-client` to
another buffer or keep `jupyter-repl-interaction-mode`
enabled.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
29ede2f44a jupyter-repl-interaction-mode: Handle buffer reverts 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
f81d77c4d2 jupyter-repl-propagate-client: Add as before advice instead of around 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
3734b2d3a4 jupyter-repl-associate-buffer: Fix interactive argument 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
ac053e16d4 jupyter-repl-scratch-buffer: Create a scratch buffer for every unique client
Also insert a message when creating a buffer to give hints
on keybindings.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
5276193502 Add jupyter-repl-interaction-mode bindings 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
c7eaed8f95 Add jupyter-repl-eval-buffer 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
19fcf4bd9a jupyter-repl-eval-string: Refactor
* Use a `cond' for readability

* Also use `jupyter-with-doc-buffer` when not inserting
  plain text results
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
dc0bccef7f jupyter-repl-eval-string: Enable auto-completion during an interactive call 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
2e0fef2649 jupyter-repl-on-kernel-restart: Only switch to the client buffer when needed 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
52e663b550 jupyter-inspect: Use the help buffer when called without a buffer
This allows us to use `help-setup-xref` so that we can
navigate backward and forward through help. This is
especially useful in the Julia kernel.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
01c58f05eb jupyter-completion--company-doc-buffer: Fix call to jupyter-inspect 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
3763764394 Abstract out company idle completion timer from jupyter-completion-at-point 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
54810022a9 Consider operators during completion 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
1f812ddf7c Limit overlay calls to jupyter-repl--make-prompt 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
f8768b7f87 jupyter-markdown-follow-link: Call jupyter-inspect when not in the REPL buffer 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
768d640beb Use with-silent-modification in jupyter-repl-append-output 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
2841753bad Consider the active region when obtaining the jupyter-code-context 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
6ab44867d1 Fix code position in jupyter-line-context
The cursor position is 1 relative, I think. At least this
gives the right results using the Julia kernel.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
5f091d972a Remove unused dependency 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
6f5c106ed5 Add note about mapping kernel languages to Emacs modes 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
4abf2daafa Update completion prefetching
* Add `jupyter-completion-prefetch-p` which determines if a
  prefetch should be performed.

* Remove `jupyter-completion-last-prefix`. Store all of the
  necessary information in `jupyter-completion-cache`.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
a4a4bfb4c8 Ask to start a new REPL if one isn't available in jupyter-repl-associate-buffer 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
4f73d1397e Ensure the buffer local value of syntax-propertize-function is set
This caused much headache. This variable really should be
automatically buffer local.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
5caf82cf81 Fix continuation prompt insertion
* Remove the invisible character inserted along with the
  continuation prompt as it is really unneeded.

* Make the inserted space two characters wide. For some
  reason this is needed, otherwise the continuation prompt
  will be one character short when starting up a REPL from
  the byte compiled functions. Curiously when I evaluate
  `jupyter-repl-insert-prompt` in the current Emacs
  session, the prompt looks fine afterwards.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
c651f16ae2 Check for both end of word and symbol in jupyter-completion-grab-symbol-cons 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
abdf63a517 Only fontify syntactically when the text is not considered fontified
Text may not have a `font-lock-face` property, but may be
marked fontified if it has a non-nil `font-lock-fontified` property.
2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
52a44b7e30 Take into account syntax-propertize-function in jupyter-repl-initialize-fontification 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
33495f0281 Don't try to insert continuation prompts on self-insert-command 2018-10-25 23:17:26 -05:00
Nathaniel Nicandro
4c95c8c6d2 Add note about possibly using indirect buffers 2018-10-25 23:17:25 -05:00
Nathaniel Nicandro
ed094f93ea Use buffer ticks in jupyter-repl-indent-line
Previously a string comparison was done to check if the
cell code was indented, this is faster.
2018-10-25 23:17:25 -05:00