From e01cd227f6e579a7ae46a3dd3848f218fe61e312 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 23 Oct 2000 05:37:24 +0000 Subject: [PATCH] (woman-italic-face, woman-bold-face, woman-unknown-face): Add dark-background variants. (woman-default-faces): Renamed from `woman-colour-faces'. Set using the stored defaults, rather than using hard-wired colors. (woman-monochrome-faces): Renamed from `woman-black-faces'. Just make the foreground `unspecified' rather than "black". (woman-menu): Rename menu entries accordingly. --- lisp/ChangeLog | 13 +++++++++++++ lisp/woman.el | 52 ++++++++++++++++++++++++++------------------------ 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5ced92fa811..78d8901ccc3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,18 @@ 2000-10-23 Miles Bader + * faces.el (face-user-default-spec, face-default-spec): New functions. + (face-spec-choose, face-spec-set): Document nil-SPEC behavior. + (frame-set-background-mode, face-set-after-frame-default): + Use `face-user-default-spec'. Simplify code slightly. + + * woman.el (woman-italic-face, woman-bold-face) + (woman-unknown-face): Add dark-background variants. + (woman-default-faces): Renamed from `woman-colour-faces'. + Set using the stored defaults, rather than using hard-wired colors. + (woman-monochrome-faces): Renamed from `woman-black-faces'. + Just make the foreground `unspecified' rather than "black". + (woman-menu): Rename menu entries accordingly. + * faces.el (header-line): Make more reasonable on mono/grayscale displays. diff --git a/lisp/woman.el b/lisp/woman.el index 134721c0ad1..e98ab8255aa 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -836,28 +836,28 @@ or different fonts." :type 'boolean :group 'woman-faces) +;; This is overkill! Troff uses just italic; Nroff uses just underline. +;; You should probably select either italic or underline as you prefer, but +;; not both, although italic and underline work together perfectly well! (defface woman-italic-face - `((t (:italic t :underline t :foreground "red"))) - "Face for italic font in man pages. -Default: italic, underlined, foreground red. -This is overkill! Troff uses just italic\; Nroff uses just underline. -You should probably select either italic or underline as you prefer, -but not both, although italic and underline work together perfectly well!" + `((((background light)) (:italic t :underline t :foreground "red")) + (((background dark)) (:italic t :underline t))) + "Face for italic font in man pages." :group 'woman-faces) (defface woman-bold-face - '((t (:bold t :foreground "blue"))) - "Face for bold font in man pages. -Default: bold, foreground blue." + '((((background light)) (:bold t :foreground "blue")) + (((background dark)) (:bold t :foreground "green2"))) + "Face for bold font in man pages." :group 'woman-faces) +;; Brown is a good compromise: it is distinguishable from the default +;; but not enough so to make font errors look terrible. (Files that use +;; non-standard fonts seem to do so badly or in idiosyncratic ways!) (defface woman-unknown-face - '((t (:foreground "brown"))) - "Face for all unknown fonts in man pages. -Default: foreground brown. -Brown is a good compromise: it is distinguishable from the default but -not enough so to make font errors look terrible. (Files that use -non-standard fonts seem to do so badly or in idiosyncratic ways!)" + '((((background light)) (:foreground "brown")) + (((background dark)) (:foreground "cyan"))) + "Face for all unknown fonts in man pages." :group 'woman-faces) (defface woman-addition-face @@ -866,17 +866,19 @@ non-standard fonts seem to do so badly or in idiosyncratic ways!)" Default: foreground orange." :group 'woman-faces) -(defun woman-colour-faces () - "Set foreground colours of italic and bold faces to red and blue." +(defun woman-default-faces () + "Set foreground colours of italic and bold faces to their default values." (interactive) - (set-face-foreground 'woman-italic-face "Red") - (set-face-foreground 'woman-bold-face "Blue")) + (face-spec-set 'woman-italic-face + (face-user-default-spec 'woman-italic-face)) + (face-spec-set 'woman-bold-face (face-user-default-spec 'woman-bold-face))) -(defun woman-black-faces () - "Set foreground colours of italic and bold faces both to black." +(defun woman-monochrome-faces () + "Set foreground colours of italic and bold faces to that of the default face. +This is usually either black or white." (interactive) - (set-face-foreground 'woman-italic-face "Black") - (set-face-foreground 'woman-bold-face "Black")) + (set-face-foreground 'woman-italic-face 'unspecified) + (set-face-foreground 'woman-bold-face 'unspecified)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Experimental font support, initially only for MS-Windows. @@ -1744,8 +1746,8 @@ Argument EVENT is the invoking mouse event." ["Use Full Frame Width" woman-toggle-fill-frame :active t :style toggle :selected woman-fill-frame] ["Reformat Last Man Page" woman-reformat-last-file t] - ["Use Coloured Main Faces" woman-colour-faces t] - ["Use Black Main Faces" woman-black-faces t] + ["Use Monochrome Main Faces" woman-monochrome-faces t] + ["Use Default Main Faces" woman-default-faces t] ["Make Contents Menu" (woman-imenu t) (not woman-imenu-done)] "--" ["Describe (Wo)Man Mode" describe-mode t] -- 2.39.2