tpapp / julia-repl

Run an inferior Julia REPL in a terminal inside Emacs
Other
170 stars 35 forks source link

Make it easier to use Revise.jl with julia-repl.el via include customization. #64

Closed wraith1995 closed 5 years ago

wraith1995 commented 5 years ago

I like to use Revise.jl as many others do. Revise.jl won't track code added via include, but will for includet; thus, a customization (julia-repl-include) is added to configure which command C-c C-b uses. To make the default include available at all times, C-c C-d is used. julia-repl-send-buffer accommodates both via optional arguments.

tpapp commented 5 years ago

Thanks for this PR (and sorry for the delay in reviewing).

I wonder if we could just hardcode includet instead of making it a customizable variable.

Also, going through julia-repl-send-buffer is not valid here, since it will just send to the REPL if the file is not saved.

I would propose the following: branching from master, just add a function julia-repl-includet-buffer, which

  1. checks if the file is saved, prompts the user to do it if not, and aborts if the user said no (we should never save stuff without prompting),

  2. then just send Revise.includet("that_file").

wraith1995 commented 5 years ago

I've modified this pull request to do as @tpapp has suggested above. This also takes #66 into account. I've bound julia-repl-includet-buffer to C-c C-d.

tpapp commented 5 years ago

Thanks for all the changes. I am testing this now and will merge soon if it works out.

tpapp commented 5 years ago

Testing reveals that I forgot about the fact that we already use C-c C-d for retrieving docs.

Please change the new binding to something else, I would suggest C-c C-t which appears to be free.

wraith1995 commented 5 years ago

I've bound it to C-c C-t as suggested.

tpapp commented 5 years ago

Thanks for this, merging. Will fix typo later.