1
1
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:
Paul Cadman 2022-11-14 09:38:07 +00:00 committed by GitHub
parent b541972d03
commit d1ec8926c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)