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

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

[nongnu] elpa/golden-ratio 38948457fd 48/95: Merge remote-tracking branc


From: ELPA Syncer
Subject: [nongnu] elpa/golden-ratio 38948457fd 48/95: Merge remote-tracking branch 'refs/remotes/upstream/master'
Date: Thu, 7 Sep 2023 22:02:12 -0400 (EDT)

branch: elpa/golden-ratio
commit 38948457fdd972c65e8076c49bc1855a750eeebe
Merge: ac6ca479cc 807c441682
Author: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Commit: Thierry Volpiatto <thierry.volpiatto@gmail.com>

    Merge remote-tracking branch 'refs/remotes/upstream/master'
---
 golden-ratio.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/golden-ratio.el b/golden-ratio.el
index eb3601c58e..1ef0ca9f7c 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -56,7 +56,7 @@ will not cause the window to be resized to the golden ratio."
   "List of extra commands used to jump to other window."
   :group 'golden-ratio
   :type '(repeat symbol))
-  
+
 ;;; Compatibility
 ;;
 (unless (fboundp 'window-resizable-p)
@@ -108,6 +108,11 @@ will not cause the window to be resized to the golden 
ratio."
     (around golden-ratio-resize-window)
   (prog1 ad-do-it (golden-ratio)))
 
+(when (fboundp 'select-window-by-number)
+  (defadvice select-window-by-number
+    (after golden-ratio-resize-window)
+    (golden-ratio) nil))
+
 (defun golden-ratio--post-command-hook ()
   (when (or (memq this-command golden-ratio-extra-commands)
             (and (consp this-command) ; A lambda form.
@@ -126,11 +131,15 @@ will not cause the window to be resized to the golden 
ratio."
         (add-hook 'window-configuration-change-hook 'golden-ratio)
         (add-hook 'post-command-hook 'golden-ratio--post-command-hook)
         (ad-activate 'other-window)
-        (ad-activate 'pop-to-buffer))
+        (ad-activate 'pop-to-buffer)
+        (when (fboundp 'select-window-by-number)
+          (ad-activate 'select-window-by-number)))
       (remove-hook 'window-configuration-change-hook 'golden-ratio)
       (remove-hook 'post-command-hook 'golden-ratio--post-command-hook)
       (ad-deactivate 'other-window)
-      (ad-activate 'pop-to-buffer)))
+      (ad-deactivate 'pop-to-buffer)
+      (when (fboundp 'select-window-by-number)
+          (ad-deactivate 'select-window-by-number))))
 
 
 (provide 'golden-ratio)



reply via email to

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