Closed dahtah closed 2 years ago
I like this! It's a great set of features to add to Snail.
For now, I have two concerns about the implementation.
Instead of adding a hard dependency on Ivy / Counsel, we should use a user-configurable read function. That way, people can use Ido, Ivy, Helm, Selectrum, or just vanilla completing-read
. See https://github.com/nex3/perspective-el/blob/2ac6aff/perspective.el#L79-L83 for an example.
Your code uses calls to JuliaSnail.start
to delineate sessions, but that doesn't work with multiple REPLs, does it? Snail supports multiple simultaneous REPLs, and the session history feature won't work right if they're used. Something can probably be done by tweaking the JULIA_HISTORY
environment variable on startup, but doing it cleanly will require some careful thought. It'd be nice not to break history for anyone who mixes Snail and non-Snail Julia use.
Replaced with #58.
This is an experiment (code is pretty dirty) but I think the functionality could be useful. I added some functions that make use of the command history recorded by the Julia REPL.
and hit "C-c C-s" in the REPL to search, Enter to insert
Hit C-c h i to insert the last line, prefix with C-u to insert the last n lines (eg C-u 4 C-c h i)
(define-key julia-snail-mode-map (kbd "C-c h o") #'julia-snail-history-occur)
(define-key julia-snail-mode-map (kbd "C-c h s") #'julia-snail-view-session-history)