Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to fix window buffer in emacs for cider error/repl

Using emacs 24.4, with clojure mode and cider-jack-in. Anytime I evaluate a wrong exception the error buffer randomly replaces buffers in any other screen splits. Now I am looking for some configuration in init.el which help me to configure something like this:

  1. When clojure mode is selected/or I opened a .clj file, cider-jack-in started by default.
  2. The screen should split in 4 parts 1 current buffer/file i opened, 1 more scratch buffer, repl and clojure error msg buffer.
like image 206
rohit Avatar asked Oct 20 '22 15:10

rohit


1 Answers

I have two settings in my init files related to similar requirement:

(add-to-list 'same-window-buffer-names "<em>nrepl</em>")

same-window-buffer-names is a built-in feature of Emacs.

The other one is a helper function I use that harnesses the sticky-windows extension.

;; Toggle window dedication
(defun toggle-window-dedicated ()
  "Toggle whether the current active window is dedicated or not"
  (interactive)
  (message
   (if (let (window (get-buffer-window (current-buffer)))
         (set-window-dedicated-p window
                                 (not (window-dedicated-p window))))
       "Window '%s' is dedicated"
     "Window '%s' is normal")
   (current-buffer)))

It's not a full answer to your question, but hopefully a good starting point :)

like image 136
peterfoldi Avatar answered Nov 02 '22 05:11

peterfoldi