30.6 Frame Titles

Every frame has a name parameter; this serves as the default for the frame title which window systems typically display at the top of the frame. You can specify a name explicitly by setting the name frame property.

Normally you don’t specify the name explicitly, and Emacs computes the frame name automatically based on a template stored in the variable frame-title-format. Emacs recomputes the name each time the frame is redisplayed.

Variable: frame-title-format

This variable specifies how to compute a name for a frame when you have not explicitly specified one (via the frame’s parameters; see Basic Parameters). The variable’s value is actually a mode line construct, just like mode-line-format, except that the ‘%c’, ‘%C’, and ‘%l’ constructs are ignored. See The Data Structure of the Mode Line.

Variable: icon-title-format

This variable specifies how to compute the name for an iconified frame when you have not explicitly specified the frame’s name via the frame’s parameters. The resulting title appears in the frame’s icon itself. If the value is a string, is should be a mode line construct like that of frame-title-format. The value can also be t, which means to use frame-title-format instead; this avoids problems with some window managers and desktop environments, where a change in a frame’s title (when a frame is iconified) is interpreted as a request to raise the frame and/or give it input focus. It is also useful if you want the frame’s title to be the same no matter if the frame is iconified or not. The default value is a string identical to the default value of frame-title-format.

Variable: multiple-frames

This variable is set automatically by Emacs. Its value is t when there are two or more frames (not counting minibuffer-only frames or invisible frames). The default value of frame-title-format uses multiple-frames so as to put the buffer name in the frame title only when there is more than one frame.

The value of this variable is not guaranteed to be accurate except while processing frame-title-format or icon-title-format.