ghostel (and ghostel-project) have no meaningful return value — they return whatever ghostel--init-buffer happens to fall through to (a process object for new buffers, nil for existing ones), and neither case is documented.
This forces callers who need the buffer to use a workaround: invoking (current-buffer) immediately after ghostel inside a save-window-excursion, relying on pop-to-buffer having changed the selected buffer as a side-effect:
(let ((buf (save-window-excursion (ghostel t) (current-buffer))))
...)
ghostel-exec already returns the process as a documented contract. The equivalent for ghostel would be returning the buffer — consistent with how most Emacs terminal commands behave (eshell, vterm, term all return the buffer).
Proposed change:
(defun ghostel (&optional arg)
...
(pop-to-buffer buffer ...)
(ghostel--init-buffer buffer identity)
buffer)
ghostel(andghostel-project) have no meaningful return value — they return whateverghostel--init-bufferhappens to fall through to (a process object for new buffers,nilfor existing ones), and neither case is documented.This forces callers who need the buffer to use a workaround: invoking
(current-buffer)immediately afterghostelinside asave-window-excursion, relying onpop-to-bufferhaving changed the selected buffer as a side-effect:ghostel-execalready returns the process as a documented contract. The equivalent forghostelwould be returning the buffer — consistent with how most Emacs terminal commands behave (eshell,vterm,termall return the buffer).Proposed change: