branch: elpa/golden-ratio
commit 6af760274b01c837032fb82d21beac3fe2135bc2
Author: Roman Gonzalez <[email protected]>
Commit: Roman Gonzalez <[email protected]>
Fixing several bugs at once
* issue #13: Adding autoload cookies
* issue #11: Ctrl-x-o not resizing correctly
* issue #6: Resize to golden-ratio when splitting windows
---
golden-ratio.el | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/golden-ratio.el b/golden-ratio.el
index c55634f76c..d012f976b7 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -6,7 +6,7 @@
;; Mantainer: Roman Gonzalez <[email protected]>
;; Created: 13 Oct 2012
;; Keywords: Window Resizing
-;; Version: 0.0.3
+;; Version: 0.0.4
;; Code inspired by ideas from Tatsuhiro Ujihisa
@@ -42,6 +42,7 @@
(enlarge-window ncol t)))))
+;;;###autoload
(defun golden-ratio ()
"Resizes current window to the golden-ratio's size specs"
(interactive)
@@ -57,17 +58,31 @@
(after golden-ratio-resize-window)
(golden-ratio))
+(defadvice other-window
+ (after golden-ratio-resize-window)
+ (golden-ratio))
+
+(defadvice split-window
+ (after golden-ratio-resize-window)
+ (golden-ratio))
+
+;;;###autoload
(defun golden-ratio-enable ()
"Enables golden-ratio's automatic window resizing"
(interactive)
- (ad-activate 'select-window))
+ (ad-activate 'select-window)
+ (ad-activate 'other-window)
+ (ad-activate 'split-window))
+;;;###autoload
(defun golden-ratio-disable ()
"Disables golden-ratio's automatic window resizing"
(interactive)
- (ad-deactivate 'select-window))
+ (ad-deactivate 'select-window)
+ (ad-deactivate 'other-window)
+ (ad-deactivate 'split-window))
(provide 'golden-ratio)