emacselispemacs-ecb

Emacs + ECB: how to set the size of a new frame


I'm a newbie with emacs (and so with ecb),when I type ecb-activate the current frame gets split into my windows layout of preference according to the sizes I saved with ecb-store-window-size (which I can later restore) which are just percentages applied to the current frame sizes.

To be clearer if I have a small frame, then activate ecb, I will get a small frame subdivided into small buffers according to my layout proportions, what I want is a bigger frame (and a way to save this bigger size without touching my default sizes for a generic emacs frame) as I activate ecb.

What am I missing? (probably it can be achieved with a hook, but how?)


Solution

  • Here is a simple way to add an hook to both the activation and deactivation of ecb:

    (add-hook 'ecb-deactivate-hook
          (lambda () (modify-all-frames-parameters '((width . 80)))))
    ;; resize the ECB window to be default (order matters here)
    (add-hook 'ecb-activate-hook (lambda () (ecb-redraw-layout)))
    (add-hook 'ecb-activate-hook
          (lambda () (modify-all-frames-parameters '((width . 120)))))
    

    It is like an hack, but it works