I'm trying to figure out how to use Emacs Code Browser (ECB) and one of the things you can do with it is set ecb-windows-width to decide how wide the ecb windows are. The problem is this sequence:
- Frame pops up on screen.
- ecb-activate gets called, scaled according to ecb-windows-width.
- default-frame-alist parameters kick in, frame gets resized.
The problem is that due to this order the width of the ecb window is set before the frame gets resized, and then doesn't get scaled.
So I'd like to run ecb-redraw-layout (or ideally just ecb-activate), but it has to happen after #3. Otherwise, some sort of ecb-dynamic-width-scale option would also work.
For what it's worth, ecb-auto-activate doesn't work, so I can't find out if that would solve it.
It looks like I've found a workaround.
Quite hackish because you're setting the width according to the default frame size that comes up first, not the size you actually use. But oh well.
I'm unfamiliar with ECB, but
after-make-frame-functions
might be helpful in running the functions you want (or running some hook function where you want to do special things with the ecb frame).after-make-frame-functions
is a list of functions that take one argument (the newly created frame), and is run after the frame is created. This doesn't apply to the initial emacs frame (on startup) because your .emacs is read after the frame is already created.