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

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

[nongnu] elpa/golden-ratio 79b1743fc1 73/95: Merge pull request #45 from


From: ELPA Syncer
Subject: [nongnu] elpa/golden-ratio 79b1743fc1 73/95: Merge pull request #45 from vkazanov/master
Date: Thu, 7 Sep 2023 22:02:15 -0400 (EDT)

branch: elpa/golden-ratio
commit 79b1743fc1a2f3462445e9ddd0a869f30065bb6d
Merge: 76f5307ad0 e2cbe68277
Author: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Commit: Thierry Volpiatto <thierry.volpiatto@gmail.com>

    Merge pull request #45 from vkazanov/master
    
    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 2fd65814a6..d5a6b58d9c 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -124,7 +124,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)
@@ -134,15 +135,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]