My emacs (on Windows) always launches with a set size, which is rather small, and if I resize it, it's not "remembered" at next start-up.
I've been playing with the following:
(set-frame-position (selected-frame) 200 2) ; pixels x y from upper left (set-frame-size (selected-frame) 110 58) ; rows and columns w h
which totally works when I execute it in the scratch buffer. I put it in my .emacs, and although now when I start the program, I can see the frame temporarily set to that size, by the time *scratch*
loads, it resets back to the small default again.
Can anyone help me fix up the above code so that it "sticks" on start-up?
The `-geometry' option controls the size and position of the initial Emacs frame. Here is the format for specifying the window geometry: `-g width x height {+-} xoffset {+-} yoffset ' Specify window size width and height (measured in character columns and lines), and positions xoffset and yoffset (measured in pixels).
Using setSize() you can give the size of frame you want but if you use pack() , it will automatically change the size of the frames according to the size of components in it.
Here's what I use in my ~/.emacs
:
(add-to-list 'default-frame-alist '(left . 0)) (add-to-list 'default-frame-alist '(top . 0)) (add-to-list 'default-frame-alist '(height . 50)) (add-to-list 'default-frame-alist '(width . 155))
(setq initial-frame-alist '( (top . 40) (left . 10) (width . 128) (height . 68) ) )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With