Fix wrong-type-argument: commandp error when opening some REPLs

This commit is contained in:
Henrik Lissner 2018-07-16 14:06:08 +02:00
parent c31bb6a744
commit 53df5178a3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -18,7 +18,11 @@
(funcall (if same-window-p #'switch-to-buffer #'pop-to-buffer)
(if (buffer-live-p buffer)
buffer
(setq buffer (save-window-excursion (call-interactively command)))
(setq buffer
(save-window-excursion
(if (commandp command)
(call-interactively command)
(funcall command))))
(unless (bufferp buffer)
(error "REPL command didn't return a buffer"))
(with-current-buffer buffer (+eval-repl-mode +1))