From 2979ad470ae9eb541af77b1855b4d70850cefc00 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 22 Dec 2020 20:32:24 -0600 Subject: Move my-split-window-sensibly --- config.org | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/config.org b/config.org index bdaf66e..5ca1a9a 100644 --- a/config.org +++ b/config.org @@ -284,34 +284,6 @@ when it errors. ** Windows -*** Split windows /more/ sensibly - -from [[https://stackoverflow.com/questions/23659909/reverse-evaluation-order-of-split-height-threshold-and-split-width-threshold-in][Stack Overflow]]. - -#+begin_src emacs-lisp - (defun my-split-window-sensibly (&optional window) - (let ((window (or window (selected-window)))) - (or (and (window-splittable-p window t) - ;; Split window horizontally. - (with-selected-window window - (split-window-right))) - (and (window-splittable-p window) - ;; Split window vertically. - (with-selected-window window - (split-window-below))) - (and (eq window (frame-root-window (window-frame window))) - (not (window-minibuffer-p window)) - ;; If WINDOW is the only window on its frame and is not the - ;; minibuffer window, try to split it horizontally disregarding - ;; the value of `split-width-threshold'. - (let ((split-width-threshold 0)) - (when (window-splittable-p window t) - (with-selected-window window - (split-window-right)))))))) - - (setq split-window-preferred-function #'my-split-window-sensibly) -#+end_src - *** Winner mode #+begin_src emacs-lisp -- cgit 1.4.1-21-gabe81