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

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

[nongnu] elpa/golden-ratio 549f94c2db 44/95: * golden-ratio.el: Clean up


From: ELPA Syncer
Subject: [nongnu] elpa/golden-ratio 549f94c2db 44/95: * golden-ratio.el: Clean up, add some commands. Ready to merge.
Date: Thu, 7 Sep 2023 22:02:12 -0400 (EDT)

branch: elpa/golden-ratio
commit 549f94c2dbadb414cc3f734452ef5d24a5263474
Author: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Commit: Thierry Volpiatto <thierry.volpiatto@gmail.com>

    * golden-ratio.el: Clean up, add some commands. Ready to merge.
---
 golden-ratio.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/golden-ratio.el b/golden-ratio.el
index 6cbdb5f059..dfe6baf6e9 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -89,12 +89,14 @@ 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))
-          (golden-p golden-ratio-mode))
-      (and golden-p (golden-ratio-mode -1))
+          (golden-p (if golden-ratio-mode 1 -1)))
+      ;; Always disable `golden-ratio-mode' to avoid
+      ;; infinite loop in `balance-windows'.
+      (golden-ratio-mode -1)
       (balance-windows)
       (golden-ratio--resize-window dims)
       (scroll-right) (recenter)
-      (and golden-p (golden-ratio-mode 1)))))
+      (golden-ratio-mode golden-p))))
 
 ;; Should return nil
 (defadvice other-window
@@ -108,7 +110,7 @@ will not cause the window to be resized to the golden 
ratio."
 
 (defun golden-ratio--post-command-hook ()
   (when (or (memq this-command golden-ratio-extra-commands)
-            (and (consp this-command)
+            (and (consp this-command) ; A lambda form.
                  (loop for com in golden-ratio-extra-commands
                        thereis (or (memq com this-command)
                                    (memq (car-safe com) this-command)))))



reply via email to

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