unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: scame <laszlomail@protonmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: [External] : Re: Could the current font-lock mechanism support font locking code in comments?
Date: Wed, 31 Mar 2021 02:10:07 +0200	[thread overview]
Message-ID: <AM9PR09MB4977FD189E19D4744CF9B355967C9@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <CO1PR10MB446664A7FAC2C6A384005B97F37D9@CO1PR10MB4466.namprd10.prod.outlook.com> (Drew Adams's message of "Tue, 30 Mar 2021 18:09:02 +0000")

Drew Adams <drew.adams@oracle.com> writes:

>> > the comment starter // should have regular comment color and the code
>> > inside should be syntax highlighted with dimmed colors of the regular
>> > faces.
>> > Does this complicate things?
>> 
>> Yes and no: AFAIK Emacs's faces don't support "dimming", so you either
>> do it the hard way and get what you describe (which requires creating new
>> faces and hence knowing which faces are used by the current
>> font-lock-rules, etc...), or you take the easy way out and just apply an
>> additional face that marks the commented out code in some other way
>> (e.g. by adding a background color).
>
> Vanilla Emacs might not have dimming, but Emacs has it.
>
> Library `doremi-frm.el' provides commands that let
> you incrementally dim or strengthen a face or frame
> foreground or background.
>
> WYSIWYG - you can see the change in a sample, with
> an original sample next to it, for comparison.  Hit
> `C-g' to cancel the changes, or `RET' to accept them.
>
> For example, command `doremi-face-bg+' changes the
> foreground color of a face.  You can change any of
> these color components at any time, switching to
> another just by typing its initial letter:
>
>   `r' - red
>   `g' - green
>   `b' - blue
>   `h' - hue (basic color)
>   `s' - saturation (purity)
>   `v' - value (brightness)
>
>   `R' - red, green, and blue, at the same time
>   `H' - hue, saturation, and value, at the same time
>
> For example, you can type `v' and use the arrow keys or
> mouse wheel to change the value component, then type `s'
> and use the arrows or wheel to change the saturation
> component, and so on, all in the same call to the command.
>
> Depending on what kind of "dimming" effect you want, it
> means changing the value (brightness) component or the
> saturation component, or both.
>
> `doremi-face-fg+ does the same thing, but acts on the
> face foreground, not background.  And `doremi-bg+' and
> `doremi-fg+' act on the frame foreground and background,
> instead of those of a particular face.
>
> `doremi-frm.el' requires these other libraries.  All are
> available on Emacs Wiki.
>
>   `doremi.el'
>   `hexrgb.el'
>   `frame-fns.el'
>   `faces+.el'
>
> Doc: https://www.emacswiki.org/emacs/DoReMi
>
> Code: https://www.emacswiki.org/emacs/download/doremi-frm.el

One way is, maybe, to use theme that support different shades of color
such as B. Batsov's implementation of Solarized. Solarized ahs 8 base
colors and 8 accent colors. Batsov has introduced 8 brither and 8 darker
shades ot those 8 accent colors. A theme creator could use that scheme
to create a syntax highlight scheme where normal syntax colors uses
those 8 accented color and brighter/darker accents in comments.

I am not sure about the approach, just an idea.



  reply	other threads:[~2021-03-31  0:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30  7:40 Could the current font-lock mechanism support font locking code in comments? scame
2021-03-30 14:06 ` Stefan Monnier
2021-03-30 15:44   ` scame
2021-03-30 16:18     ` Stefan Monnier
2021-03-30 18:09       ` [External] : " Drew Adams
2021-03-31  0:10         ` Arthur Miller [this message]
2021-03-31  1:12         ` Stefan Monnier
2021-03-31  4:36           ` Drew Adams
2021-03-31  4:38             ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR09MB4977FD189E19D4744CF9B355967C9@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=laszlomail@protonmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).