0

I want to prevent julia-repl from splitting my screen, which seems like a common request given the numbers of questions I have found relating to this. Drawing on advice found here and here, I came up with the following code for my init.el:

(setq display-buffer-alist
             '((".*" (display-buffer-reuse-window display-buffer-same-window))))

(setq display-buffer-reuse-frames t)

(setq pop-up-windows nil)

And yet when I open Emacs (emacs) and start julia-repl (M+x julia-repl), it still splits the window. My understanding is that the regex in the first command should catch all buffers and prevent splitting.

I also tried,

(add-to-list 'display-buffer-alist
           '(".*". (display-buffer-reuse-window .
                                  ((reusable-frames . t)))))

from here, too, without any success. What am I doing wrong here? Is this a quirk of julia-repl since the standard solutions don't work?

1

I assume you're referring to this piece of code: https://github.com/tpapp/julia-repl/blob/d073acb6339e99edf77833f82277afd9a076f16a/julia-repl.el#L449-L454

It doesn't use display-buffer internally, so customizations to display-buffer-alist have no effect. Ask the developer to replace switch-to-buffer-other-window with pop-to-buffer or better, hand in a pull request. In the meantime redefine the command in your init file as follows:

(with-eval-after-load 'julia-repl
  (defun julia-repl ()
    "..."
    (interactive)
    (pop-to-buffer (julia-repl-inferior-buffer))))
2
  • Perfect, thanks! Is a benefit of switch-to-buffer-other-window over pop-to-buffer? (I'm just wondering why it would've been chosen instead.) – Lyngbakr Oct 27 '20 at 18:13
  • For some reason few people are aware of display-buffer, so my guess is lack of education. – wasamasa Oct 27 '20 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.