Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

From: "Drew Adams" <[email-masked]>
Date: Tue, 4 Dec 2012 14:43:53 -0800

> >> > -(defface hi-yellow
> >> > +(defface hi-lock-1
> >> I'm not sure it's an improvement.  When choosing a face in
> >> hi-lock-face-buffer, "hi-lock-1" doesn't speak much to me 
> >> contrary to "hi-yellow".
> >
> > Not specifically related to this face, but it is a bad 
> > idea, in general (no doubt there are exceptions), for a
> > face name to advertize particular face attributes, such
> > as the color.
> 
> Depends.

I too suggested that it depends.  But it depends on what "depends" means ;-).
I.e., depends on what?  The dependence I see is that there could be exceptions
where the purpose/use/meaning of the face is in fact related to a particular
color.

> In the present case, the face has no particular purpose,

So in particular, it is NOT related to any particular color, including yellow.

> so saying that "its purpose to highlight in yellow" doesn't 
> sound like such a bad idea.

That makes as much sense (to me) as to say that its name should be
`hi-lock-rumpelstiltskin".  Unless it is true that it really always should
"highlight in yellow", regardless of the face's current color.

If all we can say is that this face is about highlighting, then the only
operative word is "highlight".  If we can be more specific - e.g., highlighting
like a marker pen, then that's what is called for.

In `highlight.el', for instance, I have a command for highlighting text by
dragging the mouse over it, like using a marker pen, aka a highlighter.

That command is called `hlt-highlighter' (it can use any face, like all `hlt-*'
commands).  If `hl-lock-yellow' were intended for this kind of highlighting then
you might call it `hl-lock-highlighter' or some such.

I have no idea what `hl-lock-yellow' is really for.  You yourself have just said
that its use has nothing to do with "yellow", however.

> Not really worse than "its purpose is to be number 2".

Is its purpose really "to highlight in yellow"?  You seem to say no, above.  But
if so then you probably don't need to define a customizable face for that.  Just
highlight in yellow.

Or if the color must always be (or is always intended to be) yellow, but users
can customize other face attributes, then using "yellow" in the name would make
sense.  In that case, the doc string should say something about this
restriction/intention wrt the color being constant.

> > The color is presumably something that the user can 
> > customize, and is typically not something that speaks
> > to the use or meaning of the face.
> 
> "2" doesn't "speak to the use or meaning of the face" very 
> much either.

You didn't hear me argue in favor of using `2' here.  Those are presumably not
the only two choices: 2 vs yellow.

On the other hand, if absolutely nothing can be said about this face other than
it is one of N hi-lock faces (none of which we can say anything else about),
then `2' is better than nothing.

It is certainly better than being overly specific and misleading, and doubly
certainly better than suggesting a specific face attribute such as a particular
color.

`hi-lock-2' does not suggest that any particular face attribute has the value
`2', unless it is something like a box line width of 2 pixels.  `hi-lock-yellow'
misleads immediately, suggesting that the face always has the color yellow.

> I think the real issue here is that hi-lock should have a customizable
> set of faces rather than a set of customizable faces.
> So if the user doesn't like hi-yellow (which should be called
> hi-lock-yellow, BTW) because she never highlights in yellow, she can
> replace it with her own face with the name she likes.

Ah, in that case you are really talking, I think, about having one or more user
options, which each has a face (or a set of faces) as value.

I don't see how that is related to the above, however.  If you call such an
option `*-yellow' then its name would still be misleading, no?  And if on the
other hand you feel that `hi-lock-2' is OK as an option name here, but not as a
face name, then I don't follow the logic.

Just why would you prefer a "customizable set of faces" over a "set of
customizable faces"?  And how does that relate to the names?