From ef88a9999004e6c26148c8d280d6a41f623d7249 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 15 Jun 2005 04:35:23 +0000 Subject: [PATCH] Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-421 Tweak which-func face 2005-06-15 Miles Bader * lisp/progmodes/which-func.el (which-func): Only inherit `font-lock-function-name-face' when that makes sense against the default mode-line face, otherwise set the face color explicitly. --- lisp/ChangeLog | 4 ++++ lisp/progmodes/which-func.el | 27 ++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 83e92a71907..13d14707284 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2005-06-15 Miles Bader + * progmodes/which-func.el (which-func): Only inherit + `font-lock-function-name-face' when that makes sense against the + default mode-line face, otherwise set the face color explicitly. + * progmodes/cperl-mode.el (cperl-init-faces): Use literal cperl faces instead of (non-existent) variables. diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 960eec2208c..a96bd076e12 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -114,9 +114,30 @@ Zero means compute the Imenu menu regardless of size." "Keymap to display on mode line which-func.") (defface which-func - '((t (:inherit font-lock-function-name-face))) - "Face used to highlight mode line function names. -Defaults to `font-lock-function-name-face' if font-lock is loaded." + ;; Whether `font-lock-function-name-face' is an appropriate face to + ;; inherit depends on the mode-line face; define several variants based + ;; on the default mode-line face. + '(;; The default mode-line face on a high-color display is a relatively + ;; light color ("grey75"), and only the light-background variant of + ;; `font-lock-function-name-face' is visible against it. + (((class color) (min-colors 88) (background light)) + :inherit font-lock-function-name-face) + ;; The default mode-line face on other display types is inverse-video; + ;; it seems that only in the dark-background case is + ;; `font-lock-function-name-face' visible against it. + (((class grayscale mono) (background dark)) + :inherit font-lock-function-name-face) + (((class color) (background light)) + :inherit font-lock-function-name-face) + ;; If none of the above cases, use an explicit color chosen to contrast + ;; well with the default mode-line face. + (((class color) (min-colors 88) (background dark)) + :foreground "Blue1") + (((background dark)) + :foreground "Blue1") + (t + :foreground "LightSkyBlue")) + "Face used to highlight mode line function names." :group 'which-func) ;; backward-compatibility alias (put 'which-func-face 'face-alias 'which-func) -- 2.39.5