[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/golden-ratio b2eb54a74c 28/95: Remove unuseful advices and
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/golden-ratio b2eb54a74c 28/95: Remove unuseful advices and create new minor mode. |
Date: |
Thu, 7 Sep 2023 22:02:11 -0400 (EDT) |
branch: elpa/golden-ratio
commit b2eb54a74c1f835b808db2a78af8d41e0ff34d80
Author: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Commit: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Remove unuseful advices and create new minor mode.
---
golden-ratio.el | 43 ++++++++++---------------------------------
1 file changed, 10 insertions(+), 33 deletions(-)
diff --git a/golden-ratio.el b/golden-ratio.el
index 0506309103..43ab2d5759 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -77,44 +77,21 @@ will not cause the window to be resized to the golden
ratio."
;(balance-windows-area)
(golden-ratio--resize-window dims))))
-;(add-hook 'window-configuration-change-hook 'golden-ratio)
-;; Should return window
-(defadvice select-window
- (around golden-ratio-resize-window)
- (prog1 ad-do-it (golden-ratio)))
-
;; Should return nil
(defadvice other-window
(after golden-ratio-resize-window)
- (golden-ratio))
-
-;; Should return window
-(defadvice split-window
- (around golden-ratio-resize-window)
- (prog1 ad-do-it (golden-ratio)))
-
-;; Should return nil
-(defadvice delete-window
- (after golden-ratio-resize-window)
- (golden-ratio))
+ (golden-ratio) nil)
;;;###autoload
-(defun golden-ratio-enable ()
- "Enables golden-ratio's automatic window resizing"
- (interactive)
- (ad-activate 'select-window)
- (ad-activate 'other-window)
- (ad-activate 'split-window)
- (ad-activate 'delete-window))
-
-;;;###autoload
-(defun golden-ratio-disable ()
- "Disables golden-ratio's automatic window resizing"
- (interactive)
- (ad-deactivate 'select-window)
- (ad-deactivate 'other-window)
- (ad-deactivate 'split-window)
- (ad-deactivate 'delete-window))
+(define-minor-mode golden-ratio-mode
+ "Enable automatic window resizing with golden ratio."
+ :lighter "Golden"
+ (if golden-ratio-mode
+ (progn
+ (add-hook 'window-configuration-change-hook 'golden-ratio)
+ (ad-activate 'other-window))
+ (remove-hook 'window-configuration-change-hook 'golden-ratio)
+ (ad-deactivate 'other-window)))
(provide 'golden-ratio)
- [nongnu] elpa/golden-ratio 0517fc134a 11/95: Replacing `window-absolute-pixel-edges` in favor of `window-pixel-edges`, (continued)
- [nongnu] elpa/golden-ratio 0517fc134a 11/95: Replacing `window-absolute-pixel-edges` in favor of `window-pixel-edges`, ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio cb8ff0bdb0 13/95: Bumping to version 0.0.3, ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio ed24985e10 14/95: Fix MELPA footer., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 0508acbd20 15/95: Merge pull request #12 from zane/melpa, ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 6af760274b 16/95: Fixing several bugs at once, ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio ff8ade7d35 19/95: Merge branch 'release/with-exemption-support', ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 7504957a7a 23/95: Merge pull request #19 from deftsp/inhabit-func, ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 2d1553431c 25/95: Merge pull request #22 from Fuco1/master, ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio c028a68645 26/95: Initial cleanup., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio d7c433c655 27/95: (golden-ratio--resize-window): Fix, it is not a cond but when twice., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio b2eb54a74c 28/95: Remove unuseful advices and create new minor mode.,
ELPA Syncer <=
- [nongnu] elpa/golden-ratio 239eb4d9cb 29/95: (golden-ratio): scroll left., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio d877ceec2c 30/95: Remove commented line., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio f547dee6ad 31/95: (golden-ratio-mode): fix lighter., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 0d7e18325d 33/95: Merge pull request #1 from thierryvolpiatto/exp, ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 7646627bbf 34/95: * golden-ratio.el: Add group., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 07fc7d7f7b 35/95: Merge branch 'master' of github.com:thierryvolpiatto/golden-ratio.el, ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 4871294c94 36/95: * golden-ratio.el (pop-to-buffer): Advice also pop-to-buffer., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 6e58cc5871 37/95: Merge branch 'origin-exp', ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio a19b9b0a3b 39/95: * golden-ratio.el: Fix window-resizable-p compatibility with 24.2., ELPA Syncer, 2023/09/07
- [nongnu] elpa/golden-ratio 19bacbeaee 40/95: * golden-ratio.el (golden-ratio--resize-window): Remove unuseful nil arg., ELPA Syncer, 2023/09/07