Closed xin-jin closed 8 years ago
This is due to the wrong usage of golden-ratio-mode
variable in golden-ratio
, I tried to fight against this change in https://github.com/roman/golden-ratio.el/pull/45 but I did not succeed in convincing the people.
You have to first set golden-ratio-mode
variable to non-nil before calling golden-ratio, you should also be able to pass a non-nil argument to the function to force it (not sure about this one, it is not documented).
cc @thierryvolpiatto @tarsius @abo-abo @roman
@xin-jin , try:
(lambda () (golden-ratio 1))
in your hook instead of golden-ratio
@thierryvolpiatto this really should not be necessary but I gave it up, I don't have more time to put into this ;-) Up to you guys, if you prefer a not documented raw argument to fix
the bad semantic attributed to golden-ratio-mode
, that's OK with me.
@thierryvolpiatto Thanks, but it doesn't seem to work. My code:
(add-hook 'inferior-python-mode-hook
(lambda () (golden-ratio 1)))
xin-jin notifications@github.com writes:
@thierryvolpiatto Thanks, but it doesn't seem to work. My code:
(add-hook 'inferior-python-mode-hook (lambda () (golden-ratio 1)))
Oops, seems that my last post never endup on github. I repost here: The problem is that when your python hook run the window is not ready, so you have to delay the call to golden-ratio, do it like this:
(add-hook 'inferior-python-mode-hook (lambda () (run-with-idle-timer 1 nil (lambda () (golden-ratio 1)))))
Thierry
@thierryvolpiatto Thanks! Now it works.
Sorry, not really an issue, just I don't know how to do it: I prefer to manually execute
golden-ratio
by a macro rather than using the golden-ratio-mode, but I would like to automatically executegolden-ratio
once when the REPL starts. I have very limited knowledge of elisp, and cannot get it to work by simply addgolden-ratio
to theinferior-python-mode-hook
.