Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
704 views
in Technique[技术] by (71.8m points)

windows - Programmatically setting Emacs frame size

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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))

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...