feature/eval: improve REPL error handling

Emit more informative error messages depending on the problem.
This commit is contained in:
Henrik Lissner 2019-04-02 18:22:01 -04:00
parent a49a9fee3a
commit ea857aa553
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -24,9 +24,12 @@
(if (commandp command) (if (commandp command)
(call-interactively command) (call-interactively command)
(funcall command)))) (funcall command))))
(unless (bufferp buffer) (cond ((null buffer)
(error "REPL command didn't return a buffer")) (error "REPL handler %S couldn't open the REPL buffer" command))
(with-current-buffer buffer (+eval-repl-mode +1)) ((not (bufferp buffer))
(error "REPL handler %S failed to return a buffer" command)))
(with-current-buffer buffer
(+eval-repl-mode +1))
(puthash key buffer +eval-repl-buffers) (puthash key buffer +eval-repl-buffers)
buffer))) buffer)))
(with-current-buffer buffer (with-current-buffer buffer