From 84bf9549860aae22931951d52b194b1fcfca1556 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 24 Nov 2021 14:48:13 +0100 Subject: [PATCH] Use a proportional font for the mode line * lisp/bindings.el (mode-line-position): Add min-width specs. (standard-mode-line-format): Ditto. * lisp/faces.el (mode-line): Inherit from `variable-pitch'. --- etc/NEWS | 4 ++++ lisp/bindings.el | 18 ++++++++++++++---- lisp/faces.el | 4 +++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1cd49c5289c..17568976cb8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -75,6 +75,10 @@ time. * Changes in Emacs 29.1 +--- +** The mode line now uses a proportional font by default. +To get the old monospaced mode line back, customize the 'mode-line' face. + +++ ** New function 'buffer-text-pixel-size'. This is similar to 'window-text-pixel-size', but can be used when the diff --git a/lisp/bindings.el b/lisp/bindings.el index 121e484a0ee..a4458ccd1e4 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -503,6 +503,7 @@ mouse-1: Display Line and Column Mode Menu")) `((:propertize mode-line-percent-position local-map ,mode-line-column-line-number-mode-map + display (min-width (5.0)) mouse-face mode-line-highlight ;; XXX needs better description help-echo "Window Scroll Percentage @@ -521,26 +522,31 @@ mouse-1: Display Line and Column Mode Menu"))) (10 (:propertize mode-line-position-column-line-format + display (min-width (10.0)) ,@mode-line-position--column-line-properties)) (10 (:propertize (:eval (string-replace "%c" "%C" (car mode-line-position-column-line-format))) + display (min-width (10.0)) ,@mode-line-position--column-line-properties))) (6 (:propertize mode-line-position-line-format + display (min-width (6.0)) ,@mode-line-position--column-line-properties)))) (column-number-mode (column-number-indicator-zero-based (6 (:propertize mode-line-position-column-format + display (min-width (6.0)) (,@mode-line-position--column-line-properties))) (6 (:propertize (:eval (string-replace "%c" "%C" (car mode-line-position-column-format))) + display (min-width (6.0)) ,@mode-line-position--column-line-properties)))))) "Mode line construct for displaying the position in the buffer. Normally displays the buffer percentage and, optionally, the @@ -597,10 +603,14 @@ By default, this shows the information specified by `global-mode-string'.") (let ((standard-mode-line-format (list "%e" 'mode-line-front-space - 'mode-line-mule-info - 'mode-line-client - 'mode-line-modified - 'mode-line-remote + (list + :propertize + (list "" + 'mode-line-mule-info + 'mode-line-client + 'mode-line-modified + 'mode-line-remote) + 'display '(min-width (4.0))) 'mode-line-frame-identification 'mode-line-buffer-identification " " diff --git a/lisp/faces.el b/lisp/faces.el index a07f8c652e4..e9f795caad2 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2611,9 +2611,11 @@ non-nil." (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)) + :inverse-video t + :inherit 'variable-pitch)) "Basic mode line face for selected window." :version "21.1" :group 'mode-line-faces -- 2.39.2