Function: set-frame-width

set-frame-width is an interactive function defined in frame.c.

Signature

(set-frame-width FRAME WIDTH &optional PRETEND PIXELWISE)

Documentation

Set text width of frame FRAME to WIDTH columns.

Optional third arg PRETEND non-nil means that redisplay should use WIDTH columns but that the idea of the actual width of the frame should not be changed.

Optional fourth argument PIXELWISE non-nil means that FRAME should be WIDTH pixels wide. Note: When frame-resize-pixelwise is nil, some window managers may refuse to honor a WIDTH that is not an integer multiple of the default frame font width.

When called interactively, WIDTH is the numeric prefix and the currently selected frame will be set to this width.

If FRAME is nil, it defaults to the selected frame.

Probably introduced at or before Emacs version 24.1.

Key Bindings

Source Code

// Defined in /usr/src/emacs/src/frame.c
{
  struct frame *f = decode_live_frame (frame);
  int text_width
    = check_frame_pixels (width, pixelwise, FRAME_COLUMN_WIDTH (f));

  /* With INHIBIT 1 pass correct text height to adjust_frame_size.  */
  adjust_frame_size
    (f, text_width, FRAME_TEXT_HEIGHT (f), 1, !NILP (pretend), Qwidth);

  return Qnil;
}