Emacs: Set Default Window (frame) Size

By Xah Lee. Date: . Last updated: .

How to set default window size?

Put this in your emacs init.

;; initial window
(setq initial-frame-alist
        (width . 102) ; character
        (height . 54) ; lines

;; default/sebsequent window
(setq default-frame-alist
        (width . 100) ; character
        (height . 52) ; lines

How to set the background color for new window?

(setq default-frame-alist
  '((background-color . "cornsilk")))

To see a list of color names emacs support, call list-colors-display.

How to set a default font?

Emacs: Font Configuration

Setup New Window/Frame Properties

initial-frame-alist is a variable that holds a alist of settings for the first window emacs starts with.

default-frame-alist is a variable that holds a alist of any new window.

Call describe-variable to see a variable's values.

(info "(elisp) Frame Parameters")

Like it? Buy Xah Emacs Tutorial. Thanks.

or, buy something from Best Keyboard for Emacs