better C-x = (safe-maximize-window) binding
[emacs-init.git] / setup / mywin.el
index 7d961c1..4fde816 100644 (file)
@@ -145,8 +145,7 @@ window smaller than MIN-HEIGHT lines."
                             (not (member name setup-my-windows-precious-buffers))) return w)
               firstwindow))
     (when (and distribute (> (length newtopwindows) 1))
-      ;;(balance-windows)
-      )
+      (pjb-balance-windows t))
     (select-window newwindow)
     (if (not (member (buffer-name currentbuffer) setup-my-windows-junk-buffers))
         (switch-to-buffer currentbuffer))))
@@ -216,5 +215,10 @@ the buffer stack in the current window."
         (error "Current window is not a top window"))
     (shrink-window-horizontally (- (- width (window-width) (* window-min-width (1- count)))))))
 
-(global-set-key "\C-x=" 'safe-max-window-horizontally)
+(defun safe-max-window ()
+  (interactive)
+  (safe-max-window-horizontally)
+  (maximize-window 5))
+
+(global-set-key "\C-x=" 'safe-max-window)
 (global-set-key "\C-x-" 'maximize-window-15)