emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Could the current font-lock mechanism support font


From: Drew Adams
Subject: RE: [External] : Re: Could the current font-lock mechanism support font locking code in comments?
Date: Tue, 30 Mar 2021 18:09:02 +0000

> > 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




reply via email to

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