Subject: bug#13686: hi-yellow vs. hi-lock-1

From: Jambunathan K <[email-masked]>
Date: Thu, 07 Mar 2013 00:26:41 +0530

Stefan Monnier <[email-masked]> writes:

>>> "hi-lock-1", "hi-lock-2", etc. are the best names.
>> My earlier mail asked for making the highlighting face a "core" one.  So
>> having highlight-1, highlight-2 etc as "core" themable faces will make
>> theme designers pay attention to it.
>
> We could definitely add such core faces.  But in order for that to
> augment current functionality, we still need a way for the user to
> specify the highlighting directly by its attribute.

Let's focus on core, themable faces.  How many you want in what prefix
or file.  I propose that these faces be named opaquely as

        hi-lock-N
        highlight-N
        font-lock-user-N
        font-lock-highlight-N
        font-lock-extra-face-N

----------------------------------------------------------------

I have also proposed that hi-yellow etc be named as
hi-lock-color-yellow etc.

My overall plan is to have a formalized version of the following with
`hi-lock-face-regexp' turned around in to a defcustom.  

    (defvar hi-lock-face-regexp "\\`hi-lock-color")

    (setq hi-lock-face-defaults
          ((lambda (regexp)       
             "List of faces that match REGEXP."
             (delq nil
                   (mapcar (lambda (f)
                             (let ((s (symbol-name f)))
                               (when (string-match regexp s) f)))
                           (reverse (face-list))))) 
           hi-lock-face-regexp))

This way those who want to be prompted with colors and those who want
opaque, themable faces will remain happy.

ps: I will provide a patch once there is a general agreement on the
approach.

----------------------------------------------------------------

>         Stefan