emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dired-warning (was: bug of display-table & make-glyph-code)


From: Juri Linkov
Subject: dired-warning (was: bug of display-table & make-glyph-code)
Date: Fri, 12 Oct 2007 02:57:29 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> Mapping dired-warning to font-lock-warning-face was a bad idea: The
> latter is already used for marking and flagging.  It seems better to use
> `font-lock-comment-delimiter-face' just for the min-colors 8 case as in
> the patch below.

Since this change was synced to the trunk and I see it in action now,
I agree it was a bad idea.

The primary intention of introducing the dired-warning face was to
warn users about possible security holes.  But red is too strong color.
There are many files and directories where permission to write is correct
(especially for groups), but displaying their permissions in red in dired
is distracting.  This color usually requires an immediate action to fix
the problem, but in most cases there are no problems.

An analogy for this situation are warnings and errors issued by the compiler:
when there is an error, it needs to be fixed, but most warnings are useless.
compile.el uses two separate faces for errors and warnings:
compilation-error and compilation-warning.  compilation-error inherits
from font-lock-warning-face, and compilation-warning has its own definition.

I propose to add a new face font-lock-error-face, to copy its definition
from font-lock-warning-face, and to copy the definition of compilation-warning
to font-lock-warning-face.  So dired-warning inheriting now from
font-lock-warning-face will use the new definition.

Making this distinction between two faces font-lock-error-face and
font-lock-warning-face will be useful for other packages where
error text should be displayed in the strong color, and warnings in
more subdued color.

PS: This proposal is for the trunk.  For Emacs-22 I think we should
restore the old color by copying definitions of font-lock-comment-face
and font-lock-comment-delimiter-face to dired-warning like:

(defface dired-warning
  '((((class color) (min-colors 88) (background light))
     (:foreground "Firebrick"))
    (((class color) (min-colors 88) (background dark))
     (:foreground "chocolate1"))
    (((class color) (min-colors 8) (background light))
     :foreground "red")
    (((class color) (min-colors 8) (background dark))
     :foreground "red1"))
  "Face used to highlight a part of a buffer that needs user attention."
  :group 'dired-faces
  :version "22.1")

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]