roman / golden-ratio.el

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

Cleanup, fix crashes emacs issues, allow using with helm, new mode golden-ratio-mode. #23

Closed thierryvolpiatto closed 11 years ago

thierryvolpiatto commented 11 years ago

Only one defadvice etc...etc...

thierryvolpiatto commented 11 years ago

Read "add some comments" in last commit :-), sorry.

thierryvolpiatto commented 11 years ago

@roman the patch is now ready to merge with all issues fixed.

roman commented 11 years ago

Thanks Thierry!

I'll be checking it out today afternoon (PST), and give you feedback. Thanks for the great work you have been doing here.

Cheers.

roman commented 11 years ago

Pull request reviewed and merged. I'm going to be adding one more defadvice, the post-command-hook doesn't do the trick for window-numbering.el given that you need to provide every select-window-1,2,... function in order to make it work; that increases the size of the golden-ratio-extra-commands list which I would prefer to keep small.

roman commented 11 years ago

@thierryvolpiatto by the way... I also gave you write access, please feel free to commit directly, I trust the code you push to the project is good.

Cheers.

thierryvolpiatto commented 11 years ago

You need only one function, i think it is window-number-select (verify i have no access to emacs right now. So no need to add another advice. Also including advices related to this library is unsafe as the library itself is buggy (it hang forever when using special display or creating a new frame ) Le 28 avr. 2013 20:29, "Roman Gonzalez" notifications@github.com a écrit :

Pull request reviewed and merged. I'm going to be adding one more defadvice, the post-command-hook doesn't do the trick for window-numbering.el given that you need to provide every select-window-1,2,... function in order to make it work; that increases the size of the golden-ratio-extra-commands list which I would prefer to keep small.

— Reply to this email directly or view it on GitHubhttps://github.com/roman/golden-ratio.el/pull/23#issuecomment-17139789 .

roman commented 11 years ago

Thierry,

The problem I can see is that when I add window-number-select on the golden-ratio-extra-commands list, it doesn't perform the resizing. My theory is that because I'm calling window-select-1 instead of window-number-select directly, the post-command-hook doesn't work :-/.

I added a conditional to check if window-number-select was available before advising it. It is not perfect but works for now. Is this change breaking things for you?

thierryvolpiatto commented 11 years ago

Well i dont use window-number-mode but i Will look into this ASAP. Le 28 avr. 2013 21:45, "Roman Gonzalez" notifications@github.com a écrit :

Thierry,

The problem I can see is that when I add window-number-select on the golden-ratio-extra-commands list, it doesn't perform the resizing. My theory is that because I'm calling window-select-1 instead of window-number-select directly, the post-command-hook doesn't work :-/.

I added a conditional to check if window-number-select was available before advising it. It is not perfect but works for now. Is this change breaking things for you?

— Reply to this email directly or view it on GitHubhttps://github.com/roman/golden-ratio.el/pull/23#issuecomment-17141177 .

thierryvolpiatto commented 11 years ago

Roman Gonzalez notifications@github.com writes:

Thierry,

The problem I can see is that when I add window-number-select on the golden-ratio-extra-commands list, it doesn't perform the resizing. My theory is that because I'm calling window-select-1 instead of window-number-select directly, the post-command-hook doesn't work :-/. Can't reproduce.

1) enable window-number-mode 2) (add-to-list 'golden-ratio-extra-commands 'window-number-select) 3) Split some windows 4) C-x C-j 3 The window '3' is resized as expected.

I added a conditional to check if window-number-select was available before advising it. It is not perfect but works for now. Is this change breaking things for you? i didn't try but I don't see why it wouldn't work, looks correct.

BTW thanks for adding write access to golden-ratio ;-)

Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

roman commented 11 years ago

Uhmm that's the thing, I'm not using C-x C-j 3, I'm using alt + 1, 2, 3 which maps to select-window-1,2,3, which are partial applications to window-number-select, but not quite window-number-select, that's why I think the post-command-hook is not working.

No worries, I think we are good that advise, it does the job for alt + X, and doesn't break installs that don't have window-numbering.el, so it should work.

Cheers.

thierryvolpiatto commented 11 years ago

Roman Gonzalez notifications@github.com writes:

Uhmm that's the thing, I'm not using C-x C-j 3, I'm using alt + 1, 2, 3 which maps to select-window-1,2,3, which are partial applications to window-number-select, but not quite window-number-select, that's why I think the post-command-hook is not working. Still can't reproduce.

If I enable window-number with window-number-meta-mode instead of window-number-mode golden-ratio resize as expected when I do e.g M-3 to switch to window '3'.

And with either window-number-mode or window-number-meta-mode when I use M-x:

C-u 3 M-x window-number-select RET golden-ratio resize window '3' as expected.

No worries, I think we are good that advise, it does the job for alt + X, and doesn't break installs that don't have window-numbering.el, so it should work.

Are you sure window-number-mode is enabled ?

I am nearly sure this advice is not needed.

Cheers.


Reply to this email directly or view it on GitHub: https://github.com/roman/golden-ratio.el/pull/23#issuecomment-17174699

Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997