Sam <[email protected]> writes:

>>> The `org-babel-scheme-execute-with-geiser' set-up still seems to
>>> display
>>> the buffer in the current window. My understanding is that
>>> `org-babel-initiate-session' shouldn't affect what windows are
>>> displayed, rather it should just return the session buffer.
>>
>> Does it mean that normal block evaluation spawns a new window now?
>
> It displays the REPL in the current window. This patch doesn't fix that
> issue (unless the user manually calls
> `org-babel-scheme-initiate-session' before evaluation) but I can make
> another if you're interested.

Do you mean displays transiently, disappearing after evaluation is complete?
If so, what about simply

(defun org-babel-scheme-get-repl (impl name &optional host port)
  "Switch to a Scheme REPL, creating it if it doesn't exist.

If the variables HOST and PORT are set, connect to the running Scheme REPL."
  (let ((buffer (org-babel-scheme-get-session-buffer name)))
    (or buffer
        (let ((inhibit-redisplay t)) ;; avoid flickering when geiser juggles 
current buffer window
          (if (fboundp 'geiser)
              (if (and host port)
                  (geiser-connect impl host port)
                (geiser impl))
            ;; Obsolete since Geiser 0.26.
            (run-geiser impl))
          (when name
            (rename-buffer name t)
            (org-babel-scheme-set-session-buffer name (current-buffer)))
          (current-buffer)))))

> +        (switch-to-buffer-obey-display-actions t)
> +        (display-buffer-overriding-action '(display-buffer-no-window
> +                                            (allow-no-window t))))

My main concern is that your approach is not future-proof. If geiser
ever changes internal mechanics of buffer popups, our code will be
broken.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to