mirror of
https://github.com/anoma/juvix.git
synced 2024-09-11 16:26:33 +03:00
Add an emacs function to restart the REPL (#1618)
This commit is contained in:
parent
b541972d03
commit
d1ec8926c4
@ -47,4 +47,16 @@
|
||||
(when proc-alive
|
||||
(comint-simple-send juvix-repl-buffer-name (concat ":load " filename)))))
|
||||
|
||||
(defun juvix-repl-restart ()
|
||||
"Restart the juvix REPL."
|
||||
(interactive)
|
||||
(let* ((buffer (get-buffer juvix-repl-buffer-name))
|
||||
(proc-alive (comint-check-proc buffer))
|
||||
(process (get-buffer-process buffer)))
|
||||
(if proc-alive
|
||||
(progn
|
||||
(set-process-sentinel process (lambda (p e) (run-juvix-repl)))
|
||||
(kill-process process))
|
||||
(error "No juvix repl process is runnning. Use run-juvix-repl"))))
|
||||
|
||||
(provide 'juvix-repl)
|
||||
|
Loading…
Reference in New Issue
Block a user