* doc/emacs/display.texi (Standard Faces): Document the new face.
* lisp/faces.el (mode-line-active): New face.
(mode-line): Don't inherit from vaiable-pitch.
* src/xfaces.c (lookup_basic_face, realize_basic_faces)
(syms_of_xfaces):
* src/xdisp.c (window_box_height, window_text_pixel_size)
(display_mode_lines, Fformat_mode_line):
* src/dispextern.h (CURRENT_MODE_LINE_ACTIVE_FACE_ID_3)
(CURRENT_MODE_LINE_ACTIVE_FACE_ID, enum face_id): Rename from
*MODE_LINE_FACE_ID to *MODE_LINE_ACTIVE_FACE_ID.
@table @code
@item mode-line
@cindex @code{mode-line} face
-@cindex faces for mode lines
-This face is used for the mode line of the currently selected window,
+This is the base face used for the mode lines, as well as header lines
and for menu bars when toolkit menus are not used. By default, it's
drawn with shadows for a raised effect on graphical displays, and
drawn as the inverse of the default face on non-windowed terminals.
+
+The @code{mode-line-active} and @code{mode-line-inactive} faces (which
+are the ones used on the mode lines) inherit from this face.
+
+@item mode-line-active
+@cindex faces for mode lines
+Like @code{mode-line}, but used for the mode line of the currently
+selected window. This face inherits from @code{mode-line}, so changes
+in that face affect mode lines in all windows.
+
@item mode-line-inactive
@cindex @code{mode-line-inactive} face
Like @code{mode-line}, but used for mode lines of the windows other
than the selected one (if @code{mode-line-in-non-selected-windows} is
non-@code{nil}). This face inherits from @code{mode-line}, so changes
in that face affect mode lines in all windows.
+
@item mode-line-highlight
@cindex @code{mode-line-highlight} face
Like @code{highlight}, but used for mouse-sensitive portions of text
on mode lines. Such portions of text typically pop up tooltips
(@pxref{Tooltips}) when the mouse pointer hovers above them.
+
@item mode-line-buffer-id
@cindex @code{mode-line-buffer-id} face
This face is used for buffer identification parts in the mode line.
+
@item header-line
@cindex @code{header-line} face
Similar to @code{mode-line} for a window's header line, which appears
at the top of a window just as the mode line appears at the bottom.
Most windows do not have a header line---only some special modes, such
Info mode, create one.
+
@item header-line-highlight
@cindex @code{header-line-highlight} face
Similar to @code{highlight} and @code{mode-line-highlight}, but used
for mouse-sensitive portions of text on header lines. This is a
separate face because the @code{header-line} face might be customized
in a way that does not interact well with @code{highlight}.
+
@item tab-line
@cindex @code{tab-line} face
Similar to @code{mode-line} for a window's tab line, which appears
at the top of a window with tabs representing window buffers.
@xref{Tab Line}.
+
@item vertical-border
@cindex @code{vertical-border} face
This face is used for the vertical divider between windows on text
terminals.
+
@item minibuffer-prompt
@cindex @code{minibuffer-prompt} face
@vindex minibuffer-prompt-properties
properties (@pxref{Text Properties,,, elisp, the Emacs Lisp Reference
Manual}) used to display the prompt text. (This variable takes effect
when you enter the minibuffer.)
+
@item fringe
@cindex @code{fringe} face
The face for the fringes to the left and right of windows on graphic
displays. (The fringes are the narrow portions of the Emacs frame
between the text area and the window's right and left borders.)
@xref{Fringes}.
+
@item cursor
The @code{:background} attribute of this face specifies the color of
the text cursor. @xref{Cursor Display}.
+
@item tooltip
This face is used for tooltip text. By default, if Emacs is built
with GTK+ support, tooltips are drawn via GTK+ and this face has no
effect. @xref{Tooltips}.
+
@item mouse
This face determines the color of the mouse pointer.
@end table
\f
* Changes in Emacs 29.1
++++
+** New face 'mode-line-active'.
+This inherits from the 'mode-line' face, but is the face actually used
+on the mode lines (along with 'mode-line-inactive').
+
---
** The mode line now uses a proportional font by default.
-To get the old monospaced mode line back, customize the 'mode-line'
-face not to inherit from the 'variable-pitch' face, or add this to
-your ~/.emacs:
+To get the old monospaced mode line back, customize the
+'mode-line-active' and 'mode-line-inactive' faces not to inherit from
+the 'variable-pitch' face, or add this to your ~/.emacs:
- (set-face-attribute 'mode-line nil :inherit 'default)
+ (set-face-attribute 'mode-line-active nil :inherit 'mode-line)
+ (set-face-attribute 'mode-line-inactive nil :inherit 'mode-line)
+++
** New function 'buffer-text-pixel-size'.
(defface mode-line
'((((class color) (min-colors 88))
:box (:line-width -1 :style released-button)
- :inherit variable-pitch
:background "grey75" :foreground "black")
(t
- :inverse-video t
- :inherit variable-pitch))
- "Basic mode line face for selected window."
+ :inverse-video t))
+ "Face for the mode lines (for the selected window) as well as header lines.
+See `mode-line-display' for the face used on mode lines."
:version "21.1"
:group 'mode-line-faces
:group 'basic-faces)
+(defface mode-line-active
+ '((t :inherit (mode-line variable-pitch)))
+ "Face for the selected mode line.
+This inherits from the `mode-line' face."
+ :version "29.1"
+ :group 'mode-line-faces
+ :group 'basic-faces)
+
(defface mode-line-inactive
'((default
- :inherit mode-line)
+ :inherit (mode-line variable-pitch))
(((class color) (min-colors 88) (background light))
:weight light
:box (:line-width -1 :color "grey75" :style nil)
compared against minibuf_window (if SELW doesn't match), and SCRW
which is compared against minibuf_selected_window (if MBW matches). */
-#define CURRENT_MODE_LINE_FACE_ID_3(SELW, MBW, SCRW) \
+#define CURRENT_MODE_LINE_ACTIVE_FACE_ID_3(SELW, MBW, SCRW) \
((!mode_line_in_non_selected_windows \
|| (SELW) == XWINDOW (selected_window) \
|| (minibuf_level > 0 \
&& !NILP (minibuf_selected_window) \
&& (MBW) == XWINDOW (minibuf_window) \
&& (SCRW) == XWINDOW (minibuf_selected_window))) \
- ? MODE_LINE_FACE_ID \
+ ? MODE_LINE_ACTIVE_FACE_ID \
: MODE_LINE_INACTIVE_FACE_ID)
/* Return the desired face id for the mode line of window W. */
-#define CURRENT_MODE_LINE_FACE_ID(W) \
- (CURRENT_MODE_LINE_FACE_ID_3((W), XWINDOW (selected_window), (W)))
+#define CURRENT_MODE_LINE_ACTIVE_FACE_ID(W) \
+ (CURRENT_MODE_LINE_ACTIVE_FACE_ID_3((W), \
+ XWINDOW (selected_window), \
+ (W)))
/* Return the current height of the mode line of window W. If not known
from W->mode_line_height, look at W's current glyph matrix, or return
= (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
: estimate_mode_line_height \
- (XFRAME ((W)->frame), CURRENT_MODE_LINE_FACE_ID (W)))))
+ (XFRAME ((W)->frame), CURRENT_MODE_LINE_ACTIVE_FACE_ID (W)))))
/* Return the current height of the header line of window W. If not known
from W->header_line_height, look at W's current glyph matrix, or return
enum face_id
{
DEFAULT_FACE_ID,
- MODE_LINE_FACE_ID,
+ MODE_LINE_ACTIVE_FACE_ID,
MODE_LINE_INACTIVE_FACE_ID,
TOOL_BAR_FACE_ID,
FRINGE_FACE_ID,
CHILD_FRAME_BORDER_FACE_ID,
TAB_BAR_FACE_ID,
TAB_LINE_FACE_ID,
+ MODE_LINE_FACE_ID,
BASIC_FACE_ID_SENTINEL
};
enum line_wrap_method line_wrap;
/* The ID of the default face to use. One of DEFAULT_FACE_ID,
- MODE_LINE_FACE_ID, etc, depending on what we are displaying. */
+ MODE_LINE_ACTIVE_FACE_ID, etc, depending on what we are
+ displaying. */
int base_face_id;
/* If `what' == IT_CHARACTER, the character and the length in bytes
if (ml_row && ml_row->mode_line_p)
height -= ml_row->height;
else
- height -= estimate_mode_line_height (f,
- CURRENT_MODE_LINE_FACE_ID (w));
+ height -= estimate_mode_line_height
+ (f, CURRENT_MODE_LINE_ACTIVE_FACE_ID (w));
}
}
= window_parameter (w, Qmode_line_format);
w->mode_line_height
- = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
+ = display_mode_line (w, CURRENT_MODE_LINE_ACTIVE_FACE_ID (w),
NILP (window_mode_line_format)
? BVAR (current_buffer, mode_line_format)
: window_mode_line_format);
will produce glyphs in that row.
BASE_FACE_ID is the id of a base face to use. It must be one of
- DEFAULT_FACE_ID for normal text, MODE_LINE_FACE_ID,
+ DEFAULT_FACE_ID for normal text, MODE_LINE_ACTIVE_FACE_ID,
MODE_LINE_INACTIVE_FACE_ID, or HEADER_LINE_FACE_ID for displaying
mode lines, or TOOL_BAR_FACE_ID for displaying the tool-bar.
- If ROW is null and BASE_FACE_ID is equal to MODE_LINE_FACE_ID,
+ If ROW is null and BASE_FACE_ID is equal to MODE_LINE_ACTIVE_FACE_ID,
MODE_LINE_INACTIVE_FACE_ID, or HEADER_LINE_FACE_ID, the iterator
will be initialized to use the corresponding mode line glyph row of
the desired matrix of W. */
appropriate. */
if (row == NULL)
{
- if (base_face_id == MODE_LINE_FACE_ID
+ if (base_face_id == MODE_LINE_ACTIVE_FACE_ID
|| base_face_id == MODE_LINE_INACTIVE_FACE_ID)
row = MATRIX_MODE_LINE_ROW (w->desired_matrix);
else if (base_face_id == TAB_LINE_FACE_ID)
Lisp_Object window_mode_line_format
= window_parameter (w, Qmode_line_format);
- y = y + display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
+ y = y + display_mode_line (w, CURRENT_MODE_LINE_ACTIVE_FACE_ID (w),
NILP (window_mode_line_format)
? BVAR (current_buffer, mode_line_format)
: window_mode_line_format);
struct window *sel_w = XWINDOW (old_selected_window);
/* Select mode line face based on the real selected window. */
- display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w),
+ display_mode_line (w,
+ CURRENT_MODE_LINE_ACTIVE_FACE_ID_3 (sel_w, sel_w, w),
NILP (window_mode_line_format)
? BVAR (current_buffer, mode_line_format)
: window_mode_line_format);
}
-/* Display mode or header/tab line of window W. FACE_ID specifies which
- line to display; it is either MODE_LINE_FACE_ID, HEADER_LINE_FACE_ID or
- TAB_LINE_FACE_ID. FORMAT is the mode/header/tab line format to
- display. Value is the pixel height of the mode/header/tab line
- displayed. */
+/* Display mode or header/tab line of window W. FACE_ID specifies
+ which line to display; it is either MODE_LINE_ACTIVE_FACE_ID,
+ HEADER_LINE_FACE_ID or TAB_LINE_FACE_ID. FORMAT is the
+ mode/header/tab line format to display. Value is the pixel height
+ of the mode/header/tab line displayed. */
static int
display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
face_id = (NILP (face) || EQ (face, Qdefault)) ? DEFAULT_FACE_ID
: EQ (face, Qt) ? (EQ (window, selected_window)
- ? MODE_LINE_FACE_ID : MODE_LINE_INACTIVE_FACE_ID)
- : EQ (face, Qmode_line) ? MODE_LINE_FACE_ID
+ ? MODE_LINE_ACTIVE_FACE_ID : MODE_LINE_INACTIVE_FACE_ID)
+ : EQ (face, Qmode_line_active) ? MODE_LINE_ACTIVE_FACE_ID
: EQ (face, Qmode_line_inactive) ? MODE_LINE_INACTIVE_FACE_ID
: EQ (face, Qheader_line) ? HEADER_LINE_FACE_ID
: EQ (face, Qtab_line) ? TAB_LINE_FACE_ID
switch (face_id)
{
case DEFAULT_FACE_ID: name = Qdefault; break;
- case MODE_LINE_FACE_ID: name = Qmode_line; break;
+ case MODE_LINE_ACTIVE_FACE_ID: name = Qmode_line_active; break;
case MODE_LINE_INACTIVE_FACE_ID: name = Qmode_line_inactive; break;
case HEADER_LINE_FACE_ID: name = Qheader_line; break;
case TAB_LINE_FACE_ID: name = Qtab_line; break;
if (realize_default_face (f))
{
realize_named_face (f, Qmode_line, MODE_LINE_FACE_ID);
+ realize_named_face (f, Qmode_line_active, MODE_LINE_ACTIVE_FACE_ID);
realize_named_face (f, Qmode_line_inactive, MODE_LINE_INACTIVE_FACE_ID);
realize_named_face (f, Qtool_bar, TOOL_BAR_FACE_ID);
realize_named_face (f, Qfringe, FRINGE_FACE_ID);
DEFSYM (Qborder, "border");
DEFSYM (Qmouse, "mouse");
DEFSYM (Qmode_line_inactive, "mode-line-inactive");
+ DEFSYM (Qmode_line_active, "mode-line-active");
DEFSYM (Qvertical_border, "vertical-border");
DEFSYM (Qwindow_divider, "window-divider");
DEFSYM (Qwindow_divider_first_pixel, "window-divider-first-pixel");