Commit ef4ab883ffe7

Vincent Demeester <vincent@sbr.pm>
2018-12-21 18:13:44
vde-windows/buffer: repl your way ๐Ÿ”
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 0b1d6ce
Changed files (2)
lisp/vde-buffers.el
@@ -56,6 +56,16 @@
     (side . right)
     (reusable-frames . visible)
     (window-width . 0.5))
+   (,(rx bos (or "*cider-repl"     ; CIDER REPL
+                 "*intero"         ; Intero REPL
+                 "*idris-repl"     ; Idris REPL
+                 "*Nix-REPL*"           ; IELM REPL
+                 "*ielm"           ; IELM REPL
+                 "*SQL"))          ; SQL REPL
+    (display-buffer-reuse-window display-buffer-in-side-window)
+    (side . bottom)
+    (reusable-frames . visible)
+    (window-height . 0.30))
    ;; Let `display-buffer' reuse visible frames for all buffers.  This must
    ;; be the last entry in `display-buffer-alist', because it overrides any
    ;; previous entry with more specific actions.
lisp/vde-windows.el
@@ -100,6 +100,41 @@
             ))
     (shackle-mode 1)))
 
+(defun mu-find-side-windows (&optional side)
+  "Get all side window if any.
+If SIDE is non-nil only get windows on that side."
+  (let (windows)
+    (walk-window-tree
+     (lambda (window)
+       (let ((window-side (window-parameter window 'window-side)))
+         (when (and window-side (or (not side) (eq window-side side)))
+           (push window windows)))))
+    windows))
+
+;;;###autoload
+(defun mu-quit-side-windows ()
+  "Quit side windows of the current frame."
+  (interactive)
+  (dolist (window (mu-find-side-windows))
+    (when (window-live-p window)
+      (quit-window nil window)
+      ;; When the window is still live, delete it
+      (when (window-live-p window)
+        (delete-window window)))))
+
+(bind-key "C-c w q" #'mu-quit-side-windows)
+
+;;;###autoload
+(defun mu-hide-side-windows ()
+  "Hide side windows of the current frame."
+  (interactive)
+  (dolist (window (mu-find-side-windows))
+    (when (window-live-p window)
+      (delete-window window))))
+
+(bind-key "C-c w h" #'mu-hide-side-windows)
+
+
 (provide 'vde-windows)
 
 ;; Local Variables: