Fork me on GitHub
#emacs
<
2018-06-08
>
theeternalpulse16:06:02

Is there something like purpose only more configurable on the fly. Let's say I have a have the repl in one window and I want to say, "only this specific buffer shall occupy this window" without defining a window name and type. Right now it dedicates it but under whatever purpose has deemed that buffer to be, which means other ones that are similar can also occupy that window.

jfntn16:06:29

@theeternalpulse that’s what the built-in set-window-dedicated-p does

theeternalpulse17:06:54

ah, I now see there's a spacemacs function that uses that behind the covers, it's not interactive so I found the one spacemacs uses instead. thanks for pointing me in the direction

;; from 
(defun spacemacs/toggle-current-window-dedication ()
  "Toggle dedication state of a window."
 (interactive)
 (let* ((window    (selected-window))
        (dedicated (window-dedicated-p window)))
   (set-window-dedicated-p window (not dedicated))
   (message "Window %sdedicated to %s"
            (if dedicated "no longer " "")
            (buffer-name))))