Skip to content
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

implement pre-run REPL hooks. #16384

Closed
wants to merge 1 commit into from
Closed

implement pre-run REPL hooks. #16384

wants to merge 1 commit into from

Conversation

jlapeyre
Copy link
Contributor

Implemented user hooks that are called after the REPL is created and setup, just before starting the REPL loop.

In .juliarc.jl, you can include code like this:

if isdefined(Base, :atreplrun)
Base.atreplrun( (repl)->repl.interface.modes[1].prompt = "newprompt>" )
end

to install a hook. Call atreplrun repeatedly to push hooks, all of which are run (more or less) just before the loop is entered.

Some people think this is useful. But, considering WIP: Add hook API to REPL #13545, maybe a more general solution is needed.

Committer: John Lapeyre lapeyre@ribot
On branch gjl/replhooks
Changes to be committed:
modified: base/REPL.jl
modified: base/client.jl

Implemented user hooks that are called after
the REPL is created and setup, just before
starting the REPL loop.
 Committer: John Lapeyre <lapeyre@ribot>
 On branch gjl/replhooks
 Changes to be committed:
	modified:   base/REPL.jl
	modified:   base/client.jl
@tkelman tkelman added needs tests Unit tests are required for this change needs docs Documentation for this change is required labels May 16, 2016
@vtjnash vtjnash closed this Jun 23, 2016
@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 23, 2016

run_frontend isn't generically coupled to the REPL started by Base._start. we already have _atreplinit, to handle some cases. other callbacks would need to be implemented as fields of the appropriate REPL type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs docs Documentation for this change is required needs tests Unit tests are required for this change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants