-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Special repl modes and sending code #32
Comments
Any suggestions for implementation? |
Good question :-), I just started digging into the |
Solution 1: simply prepend (defun julia-repl--quit-repl-mode-maybe ()
(interactive)
(with-current-buffer "*julia*"
(save-excursion
(goto-char (point-max))
(when (not (string-match-p "^julia>.*" (thing-at-point 'line t)))
(term-send-raw-string "\^H"))))) Something like this would also be useful, for the following case: send x = collect(1:100) to the repl containing a command: julia> y then there is no variable |
Thanks for the ideas, I will explore these. |
This isn't a huge deal but I thought I'd chime in: I sometimes find it helpful to be able to send code while in other REPL modes, especially since I have to leave |
@MasonProtter: just to clarify, you have
in a buffer and you want to use julia-repl to send that to the inferior process? |
Yes. As a more realistic example, I’ve been playing around lately with creating my own repl modes for DSLs and so it’s helpful to just open my special repl mode and then write and use julia-repl to send DSL code from my This works fine now but if the proposed change goes through, it would limit the usefulness of alternate repl modes. |
Good to know. I will hold off this change and think about it. |
@tpapp Interestingly, if I use |
what about a shortcut for sending something in a certain mode: or
you could also do There could be a variable that binds a key to a prefix:
this would be easily extensible and you just have to pre-pend the letter to each line before sending. |
@MasonProtter: could be the bracketed paste, but I am not sure. |
@gdkrmr: I will think about this, but I am finding it hard to find a use case. I think of shell and pkg modes as convenience features for interactive use. If I found, for example, that I am composing something complex in a buffer and sending it to the shell, I would just write a shell script. |
A DLS that is built on top of julia? For Pkg and shell you are probably right. |
To everyone interested: #36 is an attempt to fix the most obvious case, ie clear the prompt by default by sending a |
When in any special repl mode, such as
shell
,pkg
, etc. sending code to the repl does not make sense. I propose to simply snap out of the special mode, as this is usually what you want.The text was updated successfully, but these errors were encountered: