Summary: Nic's frame size
> NicFerrier has also written some frame sizing stuff [[http://marmalade-repo.org/packages/framesize|see Marmalade's FrameSize package]]. It uses key-chord by default.
‘fit-frame’(usually bound to `
C-x C-_’) does this. The resulting size (just big enough to display everything, with no wrap-around or truncation) is determined automatically, but you have control over this calculation with user variables. Alternatively, with a prefix argument,
‘fit-frame’prompts you for an absolute width and height. A negative prefix argument uses the
‘fill-column’value for the width. These packages also let you configure Emacs to automatically fit all frames.
-mm command line option:
emacs -mm, or add
Emacs.fullscreen: maximized to ~/.Xdefaults (on linux) to ensure window is maximized to fit screen on startup (useful if like me you try to run emacs on your new tiny notebook with your old config files, only to find you can’t see the minibuffer).
KDE users see KdeMaximized.
Elisp commands to set the frame size and position:
set-frame-position. This lets you do something like this:
(if window-system (set-frame-size (selected-frame) 80 24))
-geometry command line option, e.g.,
-geometry 80x24 will start Emacs at 80 characters wide by 24 characters high.
On MS Windows systems, create a shortcut to start emacs, open its property sheet, and add the command line option to the “Target” field.
On Windows systems, if you want to startup with Emacs maximised, you can do so by adding the following to your init file
Note, I (LawrenceMitchell) find that this doesn’t always work perfectly, it’s best if you have this right at the end of your init file, after everything else has been loaded.
‘after-init-hook’? – EdwardOConnor
Or you can do this in your init file:
(add-to-list 'default-frame-alist '(height . 24)) (add-to-list 'default-frame-alist '(width . 80))
Lisp:frame-restore.el is a mess. Just use this instead:
(add-hook 'after-init-hook '(lambda () (w32-send-sys-command ?\xf030)))
Under X, simply use X resources to define defaults for Emacs (or any other program). The exact mechanisms for this differ, but generally, you have your X session run xrdb on some file in your home directory, which is where you’d store your defaults. Common names for this file are .Xresources (this is basically standard on newer computers) and .Xdefaults (think 1991-ish). – EraEriksson
Here’s an example for your ~/.Xresources (or .Xdefaults):