all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Filippo Argiolas <filippo.argiolas@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Foreground color opacity
Date: Mon, 11 Sep 2023 18:25:50 +0200	[thread overview]
Message-ID: <CAOdrLGKhUn+yJ8hh8ixt48cWhdRjJaH-h+Ff03VQKukVJq6E+w@mail.gmail.com> (raw)
In-Reply-To: <838r9crel3.fsf@gnu.org>

On Mon, Sep 11, 2023 at 4:04 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Filippo Argiolas <filippo.argiolas@gmail.com>
> > Date: Mon, 11 Sep 2023 15:09:45 +0200
> > Cc: emacs-devel@gnu.org
> >
> > > Why not cover the "inactive" portion with an overlay which has the
> > > 'face' (or font-lock-face) property that specifies only the opacity?
> > > That is IMO simpler and doesn't need to run any functions after
> > > fontifications.
> > >
> > > (Caveat: I didn't actually try this approach, so maybe I'm missing
> > > something.)
> > >
> > > Thanks.
> >
> > That would be the perfect solution, but as far as I can tell we don't
> > have an opacity face attribute, do we?
>
> Too bad.  (The alpha parameter is what I had in mind , but I see now
> that it's only supported for the entire frame, not for a single face.)

Right, I looked into that as well but it seems it's just to set the
whole frame as semitransparent with compositing window managers.

> Anyway, it sounds inelegant that we need to jump through such hoops to
> achieve such a simple effect.  It could even be a problem, if some
> Lisp program expects to find the font-lock faces in a buffer, but
> instead sees your special faces which replaced them.  E.g., don't we
> have features that detect strings and comments in code by looking for
> their respective font-lock faces?

Agreed that's inelegant, unfortunately it's the only way I found so
far without changing the backend, i.e. that works with current Emacs.
Started this thread to see if anyone has a better solution in mind
besides introducing a new opacity/alpha attribute.

Didn't encounter any issue so far with c and c-ts modes but something
like you described could definitely happen if someone relies on font
face to detect symbol type. I'd say that's kind of an unsafe aspect to
rely on. Do you have any example in mind of code doing that so I could
run some tests?

Filippo



  parent reply	other threads:[~2023-09-11 16:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 10:45 Foreground color opacity Filippo Argiolas
2023-09-11 12:58 ` Eli Zaretskii
2023-09-11 13:09   ` Filippo Argiolas
2023-09-11 14:04     ` Eli Zaretskii
2023-09-11 14:58       ` [External] : " Drew Adams
2023-09-11 16:08         ` Filippo Argiolas
2023-09-11 16:25       ` Filippo Argiolas [this message]
2023-09-11 16:56         ` Eli Zaretskii
2023-09-11 19:00           ` Filippo Argiolas
2023-09-12  2:21             ` Eli Zaretskii
2023-09-12  4:55               ` Filippo Argiolas
2023-09-12  5:24                 ` Filippo Argiolas

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=CAOdrLGKhUn+yJ8hh8ixt48cWhdRjJaH-h+Ff03VQKukVJq6E+w@mail.gmail.com \
    --to=filippo.argiolas@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.