Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: set-frame-height doesn't work when I create a new frame

In my .emacs initialisation file, I have a command called (set-frame-height (selected frame) 55) which resizes the frame height so it takes up most of my vertical screen space. I have this command placed at the end of the .emacs file to make sure it works.

I like to make multiples copies of the frame so that I can work on different sections of the same piece of code simultaneously. The problem is that when I create a new frame using C-x 5 2 then the new frame doesn't take on the frame size I want. Instead it goes back to the default frame size. How do I fix this?

Thanks

like image 899
Eddy Avatar asked Jul 11 '11 11:07

Eddy


1 Answers

For new frames you can setup parameters in default-frame-alist variable, for example, following way:

(add-to-list 'default-frame-alist '(height . 48))

I have following code in my config:

(add-to-list 'default-frame-alist '(font . "Consolas-13"))
(add-to-list 'default-frame-alist '(height . 48))
(add-to-list 'default-frame-alist '(width . 145))
(add-to-list 'default-frame-alist '(background-color . "grey92"))
(setq initial-frame-alist default-frame-alist)
(setq special-display-frame-alist default-frame-alist)

to setup parameters for all frames...

like image 76
Alex Ott Avatar answered Sep 21 '22 12:09

Alex Ott