all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: scame <laszlomail@protonmail.com>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Could the current font-lock mechanism support font locking code in comments?
Date: Tue, 30 Mar 2021 12:18:38 -0400	[thread overview]
Message-ID: <jwvlfa4pqh0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <z53VSylhIOxS_84cvsqE2qROOufd5oQ_islIz5-iXxkH709PFMbwpjXKCN0HXPVdoO-9-sHG9NtsSXcXOsWqu8GG42u47_tK-n_MvEouiTQ=@protonmail.com> (scame's message of "Tue, 30 Mar 2021 15:44:55 +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).


        Stefan




  reply	other threads:[~2021-03-30 16:18 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 [this message]
2021-03-30 18:09       ` [External] : " Drew Adams
2021-03-31  0:10         ` Arthur Miller
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

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

  git send-email \
    --in-reply-to=jwvlfa4pqh0.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=laszlomail@protonmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.