roman / golden-ratio.el

Automatic resizing of Emacs windows to the golden ratio
MIT License
589 stars 38 forks source link

[feature request] worked with ace-window. #68

Open zw963 opened 8 years ago

zw963 commented 8 years ago

ace-window is a easy way switch multi-window/frame quickly.

picture

Thanks.

ChillarAnand commented 8 years ago

Is it working with ace-window?

I've installed both packages. When i switch window using ace-window, golden ratio is not resizing.

FrancisMurillo commented 8 years ago

I have a similar problem with window-numbering-mode where when I switched windows it would not resize accordingly. The approach might be to advice select-window or to create hooks in either ace-window or golden-ratio or what have you. The answer to advising select-window(#57 ) might be good enough.

Without being too wordy on the reference, this snippet might help you friend... I think.

;; Refer to issue #57 for the complete code, this is just for ease
(add-hook 'buffer-list-update-hook #'golden-ratio) 
(add-hook 'focus-in-hook           #'golden-ratio)
(add-hook 'focus-out-hook          #'golden-ratio)
dieggsy commented 7 years ago

I was able to get this working with ace-window using the following advice (new advice syntax):

(define-advice select-window (:after (window &optional no-record) golden-ratio-resize-window)
    (golden-ratio)
    nil)