branch: elpa/golden-ratio
commit d7c433c655e9facaf0f977e30858b17671bd05e3
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    (golden-ratio--resize-window): Fix, it is not a cond but when twice.
---
 golden-ratio.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/golden-ratio.el b/golden-ratio.el
index e2eae88102..0506309103 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -53,13 +53,12 @@ will not cause the window to be resized to the golden 
ratio."
 
 (defun golden-ratio--resize-window (dimensions &optional window)
   (with-selected-window (or window (selected-window))
-    (let (              ;(edges           (window-pixel-edges window))
-          (nrow (floor (- (first dimensions)  (window-height))))
-          (ncol (floor (- (second dimensions) (window-width)))))
-      (cond ((not (window-full-height-p))
-             (enlarge-window nrow nil))
-            ((not (window-full-width-p))
-             (enlarge-window ncol t))))))
+    (let ((nrow  (floor (- (first  dimensions) (window-height))))
+          (ncol  (floor (- (second dimensions) (window-width)))))
+      (when (not (window-full-height-p))
+        (enlarge-window nrow nil))
+      (when (not (window-full-width-p))
+        (enlarge-window ncol t)))))
 
 ;;;###autoload
 (defun golden-ratio ()
@@ -75,9 +74,10 @@ will not cause the window to be resized to the golden ratio."
                    (loop for fun in golden-ratio-inhibit-functions
                          always (funcall fun))))
     (let ((dims (golden-ratio--dimensions)))
-      (balance-windows)
+      ;(balance-windows-area)
       (golden-ratio--resize-window dims))))
 
+;(add-hook 'window-configuration-change-hook 'golden-ratio)
 ;; Should return window
 (defadvice select-window
   (around golden-ratio-resize-window)

Reply via email to