[Top][All Lists]

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

RE: Re: 23.0.50; Middle ``wZZ in of permissions in dired-mode is red and

From: Drew Adams
Subject: RE: Re: 23.0.50; Middle ``wZZ in of permissions in dired-mode is red and bold: dired-warning
Date: Sat, 13 Oct 2007 22:40:21 -0700

> With my latest change, you can do that by customizing the new face
> dired-warn-writable.

Good. So we've come almost full circle. There was already a separate face
for this in the original (dired+.el), except that the face did not have a
name that included "warn" (what are you WARNING about, anyway?). In the
original, there was a separate face for each file privilege: read, write,
execute (and also dir, link, and rare (bcsmpS)). There was no association of
a warning with writable files. And there still is no need for any warning or
for any alarmingly bright face for a write permission.

The attempt to reuse `font-lock-warning-face' for the totally unrelated
purpose of a file permission was misguided. After people complained and
sensed that that was a mistake, someone changed it briefly from
`font-lock-warning-face' to `font-lock-comment-delimiter-face'. That was
just as misguided. The problem was not just that a bright red face was
inappropriate; the problem was that there was no dedicated face for this, so
users had to reuse some existing face. And now we still see "warn" in the
face name, presumably for purely legacy reasons. What's that about?

There is a lesson in this. The real mistake was trying to avoid defining
separate faces for the different font-lock components of the Dired display.
I don't know what motivates such behavior, but I see it repeated over and
over. Perhaps it's for reasons of presumed economy; if so, it is a false

I really don't understand this propensity to reuse faces in contexts that
have no semantic connection. What if a user has a completely different frame
background for programming modes and for Dired? Dired has no notion of
comments, so why coopt a comment face to use in Dired? And what does a
warning have to do with a write permission? These things are totally
unrelated, but they end up being related by force because some implementors
are too conservative in creating new faces.

This artificial reuse produces unnecessary coupling - making a user search
for a face that fits both a file permission and either warnings or code
commenting - good luck! There is no logical connection, and there is no
reason to impose a connection. Even now, after you have removed that
coupling (thank you), there remains a vestigial trace of it in the "warn"
name you still use - `dired-warn-writable'? Yuck!

It is of course OK to reuse an existing face as a default value for a new
face. But I don't understand why there is so much resistance to defining new

People have used dired+.el for over a decade without reporting any problem
with the faces - they could do what they wanted with them. The only user
requests wrt dired+.el faces over the years were for more, not fewer, to
distinguish additional aspects of the display. The last such request I
received was just this past September - for his own use, a user added a new
font-lock pattern and a new face, to color the whole file name when the file
was of a certain type. I chose not to add that to dired+.el, but it shows
that users want more control over the appearance, not less.

[Wager: The day we add an easy, interactive, WYSIWYG way for users to define
some of their own font-locking (that would be a useful feature, IMO), they
will font-lock more, not less.]

Make it easy for people to customize the appearance as they like, by having
separate faces for logically separate components. A warning and a
file-permission indicator have nothing in common. If you find yourself
coupling such things, you are likely making a mistake.

Wrt those who are annoyed by "too much" such Dired highlighting: I haven't
checked how this was recently implemented in vanilla Emacs, but in dired+ it
is relegated to a second level of highlighting, so you see it only if you
choose `font-lock-maximum-decoration'. And of course all Dired highlighting
goes away if you turn off `font-lock-mode'. I'd hope that there is similar
user control in vanilla Emacs now: from customizing individual Dired faces,
to choosing a font-lock level, to turning font-lock off altogether.

FWIW, dired+ is here: http://www.emacswiki.org/cgi-bin/wiki/DiredPlus.

reply via email to

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