From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#6117: 24.0.50; dired-marked-face same as dired-flagged-face Date: Wed, 17 Aug 2011 22:35:45 +0300 Organization: JURTA Message-ID: <87ippvhm3g.fsf@mail.jurta.org> References: <87ljbyt7jg.fsf@jidanni.org> <871uwt38q1.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1313609902 3018 80.91.229.12 (17 Aug 2011 19:38:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 17 Aug 2011 19:38:22 +0000 (UTC) Cc: 6117@debbugs.gnu.org, 'Lars Magne Ingebrigtsen' , 'Chong Yidong' , jidanni@jidanni.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 17 21:38:17 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QtlwL-0004jD-8M for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Aug 2011 21:38:13 +0200 Original-Received: from localhost ([::1]:33416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtlwK-0004bX-QS for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Aug 2011 15:38:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtlwH-0004bH-UV for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 15:38:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QtlwG-000282-H0 for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 15:38:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtlwG-00027y-E5 for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 15:38:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qtly6-0005JL-QA; Wed, 17 Aug 2011 15:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Aug 2011 19:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 6117-submit@debbugs.gnu.org id=B6117.131360994820343 (code B ref 6117); Wed, 17 Aug 2011 19:40:02 +0000 Original-Received: (at 6117) by debbugs.gnu.org; 17 Aug 2011 19:39:08 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QtlxD-0005I3-Gu for submit@debbugs.gnu.org; Wed, 17 Aug 2011 15:39:07 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QtlxA-0005Ht-RX for 6117@debbugs.gnu.org; Wed, 17 Aug 2011 15:39:06 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 0D2B66E807E; Wed, 17 Aug 2011 12:37:09 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6B910451C137; Wed, 17 Aug 2011 12:37:07 -0700 (PDT) In-Reply-To: (Drew Adams's message of "Wed, 10 Aug 2011 06:45:46 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 17 Aug 2011 15:40:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50112 Archived-At: > It is simply a bad idea to inherit from a font-lock face here. Yes, basically the inheritance is a convenient tool to allow the user to modify a set of faces by editing one parent face, but only if these faces are semantically related. Font-lock faces semantically correspond to the entities existing in programming languages like comments, strings, keywords, function-names, variable-names, constants. So to create a reasonable face hierarchy, we should introduce faces with a universal color code like traffic lights where the red color denotes a dangerous activity or errors, the yellow/amber color denotes a caution, and the green color denotes a successful activity. In the patch below, I've removed the regression and restored traditional pre-24 colors in compilation and dired, and also changed `dired-flagged' to inherit from the `error' face, and `dired-marked' from `warning'. There are more places that need these new faces to indicate error/warning/success, e.g. battery.el and other packages unrelated to font-lock that currently abuse font-lock faces. They could be modified later. === modified file 'lisp/dired.el' --- lisp/dired.el 2011-08-10 08:40:46 +0000 +++ lisp/dired.el 2011-08-17 19:31:50 +0000 @@ -342,7 +342,7 @@ (defvar dired-mark-face 'dired-mark "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 @@ (defvar dired-marked-face 'dired-marked "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") === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2011-07-25 08:23:29 +0000 +++ lisp/progmodes/compile.el 2011-08-17 19:32:45 +0000 @@ -647,19 +647,19 @@ (defvar compilation-environment nil (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") === modified file 'lisp/faces.el' --- lisp/faces.el 2011-08-10 18:17:21 +0000 +++ lisp/faces.el 2011-08-17 19:31:45 +0000 @@ -2427,6 +2427,39 @@ (defface glyphless-char 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))) + "Face used to highlight errors." + :version "24.1" + :group 'basic-faces) + +(defface warning + '((((class color) (min-colors 16)) (:foreground "Orange" :weight bold)) + (((class color)) (:foreground "cyan" :weight bold)) + (t (:weight bold))) + "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))) + "Face used to indicate success." + :version "24.1" + :group 'basic-faces) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Manipulating font names. === modified file 'lisp/font-lock.el' --- lisp/font-lock.el 2011-07-14 13:50:25 +0000 +++ lisp/font-lock.el 2011-08-17 19:32:27 +0000 @@ -1959,12 +1959,7 @@ (defface font-lock-constant-face :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)