branch: elpa/golden-ratio
commit 6e58cc58714f0c5e212f14765b6aeef68501e220
Merge: 07fc7d7f7b 4871294c94
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Merge branch 'origin-exp'
---
golden-ratio.el | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/golden-ratio.el b/golden-ratio.el
index 32974cace6..5782b77a34 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -100,9 +100,14 @@ will not cause the window to be resized to the golden
ratio."
;; Should return nil
(defadvice other-window
- (after golden-ratio-resize-window)
+ (after golden-ratio-resize-window)
(golden-ratio) nil)
+;; Should return the buffer
+(defadvice pop-to-buffer
+ (around golden-ratio-resize-window)
+ (prog1 ad-do-it (golden-ratio)))
+
;;;###autoload
(define-minor-mode golden-ratio-mode
"Enable automatic window resizing with golden ratio."
@@ -110,9 +115,11 @@ will not cause the window to be resized to the golden
ratio."
(if golden-ratio-mode
(progn
(add-hook 'window-configuration-change-hook 'golden-ratio)
- (ad-activate 'other-window))
+ (ad-activate 'other-window)
+ (ad-activate 'pop-to-buffer))
(remove-hook 'window-configuration-change-hook 'golden-ratio)
- (ad-deactivate 'other-window)))
+ (ad-deactivate 'other-window)
+ (ad-activate 'pop-to-buffer)))
(provide 'golden-ratio)