-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add replhook() for REPL customization from juliarc #10782
Conversation
Travis failure is unrelated (it's in linalg/symmetric). |
Seems like a good idea to me. |
It might be good to keep the name in parallel with |
@phobon that's a good point, and in fact I wasn't satisfied with the name |
Partially addresses #10779
5ded5ff
to
f3ddea9
Compare
f3ddea9
to
5ac590d
Compare
Add replhook() for REPL customization from juliarc
I went with |
Is it possible to import a module to REPL with this patch? |
NVM, I figured that I just need to use atreplinit() do repl
eval(Expr(:using, :Scical))
end |
Module import doesn't have any connection to the REPL. If that code is in your juliarc.jl file, it would do the same thing to just have The patch was just introduced because now the REPL environment has not yet been created when the juliarc.jl file is first read. So you have to defer any customization of the REPL to a function that will be invoked after it is created. |
My point was that I only want to do this in a interactive session but not when running a script. And this PR helps to achieve just that. (since |
That issue should probably remain open regarding |
Is there a interactive shell that doesn't have REPL? Also note that the command line option |
I just meant that doing:
is probably the more ideal way to get that ability rather than using |
Well, IMHO, it's not a big issue because there's not loss in function. (And actually I was using a Also, I noticed that I can just use |
So before I can do (if I don't need
Now I use
I don't think the difference between the two matters too much. |
This brings back a way to customize the REPL by defining and registering hooks in .juliarc.jl.
It does so by exporting a
replhook
function, which works similarly to theatexit
function. However, it could also be left unexported.Partially addresses #10779.
I wanted to get some feedback before adding documentation etc.