branch: elpa/golden-ratio
commit 4871294c94e59c960184fff4b137744a6c28f41c
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
* golden-ratio.el (pop-to-buffer): Advice also pop-to-buffer.
---
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)