From: Juri Linkov Date: Thu, 18 Aug 2011 11:36:19 +0000 (+0300) Subject: * lisp/faces.el (error, warning, success): New faces with definitions X-Git-Tag: emacs-pretest-24.0.90~104^2~124^2~16 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bc987f8b80cbab4d8319d05a9499c615213a0685;p=emacs.git * lisp/faces.el (error, warning, success): New faces with definitions copied from old default values of `font-lock-warning-face', `compilation-warning', `compilation-info'. * lisp/font-lock.el (font-lock-warning-face): Inherit from `error'. * lisp/progmodes/compile.el (compilation-error): Inherit from `error'. (compilation-warning): Inherit from `warning'. (compilation-info): Inherit from `success'. * lisp/dired.el (dired-marked): Inherit from `warning'. (dired-flagged): Inherit from `error'. Fixes: debbugs:6117 --- diff --git a/etc/NEWS b/etc/NEWS index ed472a5668a..7b46259f7d9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -234,6 +234,9 @@ these image types, minus those listed in `imagemagick-types-inhibit'. See the Emacs Lisp Reference Manual for more information. +** New basic faces `error', `warning', `success' are available to +highlight strings that indicate failure, caution or successful operation. + ** The colors for selected text (the region face) are taken from the GTK theme when Emacs is built with GTK. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f57bd437af6..4f0e832bc67 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2011-08-18 Juri Linkov + + * faces.el (error, warning, success): New faces with definitions + copied from old default values of `font-lock-warning-face', + `compilation-warning', `compilation-info' (bug#6117). + + * font-lock.el (font-lock-warning-face): Inherit from `error'. + + * progmodes/compile.el (compilation-error): Inherit from `error'. + (compilation-warning): Inherit from `warning'. + (compilation-info): Inherit from `success'. + + * dired.el (dired-marked): Inherit from `warning'. + (dired-flagged): Inherit from `error'. + 2011-08-17 Lars Magne Ingebrigtsen * mail/smtpmail.el (auth-source): Require to avoid problems with diff --git a/lisp/dired.el b/lisp/dired.el index 746c16ff148..ecb626a275e 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -342,7 +342,7 @@ Subexpression 2 must end right before the \\n or \\r.") "Face name used for dired marks.") (defface dired-marked - '((t (:inherit font-lock-warning-face))) + '((t (:inherit warning))) "Face used for marked files." :group 'dired-faces :version "22.1") @@ -350,7 +350,7 @@ Subexpression 2 must end right before the \\n or \\r.") "Face name used for marked files.") (defface dired-flagged - '((t (:inherit font-lock-variable-name-face))) + '((t (:inherit error))) "Face used for files flagged for deletion." :group 'dired-faces :version "22.1") diff --git a/lisp/faces.el b/lisp/faces.el index 9a78ab69caa..404bd7b6609 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2413,6 +2413,39 @@ Note: Other faces cannot inherit from the cursor face." It is used for characters of no fonts too." :version "24.1" :group 'basic-faces) + +(defface error + '((((class color) (min-colors 88) (background light)) (:foreground "Red1" :weight bold)) + (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold)) + (((class color) (min-colors 16) (background light)) (:foreground "Red1" :weight bold)) + (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold)) + (((class color) (min-colors 8)) (:foreground "red")) + (t (:inverse-video t :weight bold))) + "Basic face used to highlight errors and to denote failure." + :version "24.1" + :group 'basic-faces) + +(defface warning + '((((class color) (min-colors 16)) (:foreground "DarkOrange" :weight bold)) + (((class color)) (:foreground "yellow" :weight bold)) + (t (:weight bold))) + "Basic face used to highlight warnings." + :version "24.1" + :group 'basic-faces) + +(defface success + '((((class color) (min-colors 16) (background light)) + (:foreground "Green3" :weight bold)) + (((class color) (min-colors 88) (background dark)) + (:foreground "Green1" :weight bold)) + (((class color) (min-colors 16) (background dark)) + (:foreground "Green" :weight bold)) + (((class color)) (:foreground "green" :weight bold)) + (t (:weight bold))) + "Basic face used to indicate successful operation." + :version "24.1" + :group 'basic-faces) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Manipulating font names. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 6902ce98ab1..9cf889e1aec 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1959,12 +1959,7 @@ Sets various variables using `font-lock-defaults' and :group 'font-lock-faces) (defface font-lock-warning-face - '((((class color) (min-colors 88) (background light)) (:foreground "Red1" :weight bold)) - (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold)) - (((class color) (min-colors 16) (background light)) (:foreground "Red1" :weight bold)) - (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold)) - (((class color) (min-colors 8)) (:foreground "red")) - (t (:inverse-video t :weight bold))) + '((t :inherit error)) "Font Lock mode face used to highlight warnings." :group 'font-lock-faces) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 503698f0f7b..f3b873c8b1e 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -647,19 +647,19 @@ starting the compilation process.") (defvar compile-history nil) (defface compilation-error - '((t :inherit font-lock-warning-face)) + '((t :inherit error)) "Face used to highlight compiler errors." :group 'compilation :version "22.1") (defface compilation-warning - '((t :inherit font-lock-variable-name-face)) + '((t :inherit warning)) "Face used to highlight compiler warnings." :group 'compilation :version "22.1") (defface compilation-info - '((t :inherit font-lock-type-face)) + '((t :inherit success)) "Face used to highlight compiler information." :group 'compilation :version "22.1")