cider

onetom 2025-05-12T08:25:21.067489Z

im wondering why doesn't cider-quit and sesman-quit also does a kill-window, since cider-jack-in-clj creates a new window for the REPL? it's not very symmetrical. eg. if i open a help window (eg. with C-h m) and press q in it, it kills that help window (and buries the buffer OR kills the buffer if i used C-u q). i was expecting a similar symmetry.

onetom 2025-05-12T08:27:59.927739Z

of course i can advise them, but i don't want to introduce unnecessary complications, if there is a good reason for the current behaviour or if there are other, more emacs-y solutions, like some universal args, config options or similar trickery as C-x 4 4, which modifies the behaviour of a subsequent command.

Roma 2025-05-12T08:44:02.139239Z

I've solved it for myself by displaying a repl buffer in a side window, but I think just using dedicated window will also work. Not ideal, but it works for me 🙂

(setopt display-buffer-alist
        `((,(rx (| "*cider-doc*"
                   "*cider-clojuredocs*"
                   "*cider-macroexpansion*"
                   (: "*cider-repl" (* any) "*")
                   "*cider-spec-browser*"
                   "*cljr-find-usages*"))
           (display-buffer-in-side-window)
           (side . bottom)
           (slot . 1)
           (dedicated . t)
           (window-height . 0.3))))

onetom 2025-05-12T08:48:12.570469Z

yeah, that bakes in the assumption of where that side-window should appear, which might differ between users or even just the currently used display ratios. but thanks for the idea!

Roma 2025-05-12T08:49:06.576749Z

you can use any other rule, just (dedicated . t) should do the trick

Roma 2025-05-12T08:49:38.889659Z

I think default action is (display-buffer-in-some-window) or something like that

Roma 2025-05-12T08:50:31.606399Z

(setopt display-buffer-alist
        `((,(rx "*cider-repl" (* any) "*")
           (display-buffer-in-some-window)
           (dedicated . t))))

Roma 2025-05-12T08:51:31.918509Z

There is also a function set-window-dedicated-p which probably can be used in some CIDER hook

onetom 2025-05-12T08:57:18.996679Z

thx, this seems to work for my setup:

(display-buffer-pop-up-window)
(dedicated . t)           
display-buffer-use-some-window reused my source code window 🙂

Roma 2025-05-12T08:58:23.696959Z

👍