emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/golden-ratio e2cbe68277 71/95: Use a common way to avoid r


From: ELPA Syncer
Subject: [nongnu] elpa/golden-ratio e2cbe68277 71/95: Use a common way to avoid recursion
Date: Thu, 7 Sep 2023 22:02:14 -0400 (EDT)

branch: elpa/golden-ratio
commit e2cbe68277e3f4ccbd901c6116ac7ac45fac460b
Author: Vladimir Kazanov <vkazanov@inbox.ru>
Commit: Vladimir Kazanov <vkazanov@inbox.ru>

    Use a common way to avoid recursion
---
 golden-ratio.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/golden-ratio.el b/golden-ratio.el
index b28e88bb75..c9a75f1646 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -84,7 +84,8 @@ will not cause the window to be resized to the golden ratio."
 (defun golden-ratio ()
   "Resizes current window to the golden-ratio's size specs."
   (interactive)
-  (unless (or (window-minibuffer-p)
+  (unless (or (not golden-ratio-mode)
+              (window-minibuffer-p)
               (one-window-p)
               (member (symbol-name major-mode)
                       golden-ratio-exclude-modes)
@@ -94,15 +95,13 @@ will not cause the window to be resized to the golden 
ratio."
                    (loop for fun in golden-ratio-inhibit-functions
                          thereis (funcall fun))))
     (let ((dims (golden-ratio--dimensions))
-          (golden-p (if golden-ratio-mode 1 -1)))
+          (golden-ratio-mode nil))
       ;; Always disable `golden-ratio-mode' to avoid
       ;; infinite loop in `balance-windows'.
-      (golden-ratio-mode -1)
       (balance-windows)
       (golden-ratio--resize-window dims)
       (when golden-ratio-recenter
-        (scroll-right) (recenter))
-      (golden-ratio-mode golden-p))))
+        (scroll-right) (recenter)))))
 
 ;; Should return nil
 (defadvice other-window



reply via email to

[Prev in Thread] Current Thread [Next in Thread]