From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filippo Argiolas Newsgroups: gmane.emacs.devel Subject: Re: Foreground color opacity Date: Mon, 11 Sep 2023 18:25:50 +0200 Message-ID: References: <83fs3krhmi.fsf@gnu.org> <838r9crel3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10171"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 11 18:27:00 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qfjkZ-0002QH-Jd for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Sep 2023 18:26:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfjjn-0001WR-7O; Mon, 11 Sep 2023 12:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfjjk-0001Vd-U9 for emacs-devel@gnu.org; Mon, 11 Sep 2023 12:26:08 -0400 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfjjh-00071c-Og; Mon, 11 Sep 2023 12:26:08 -0400 Original-Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5657add1073so3086957a12.0; Mon, 11 Sep 2023 09:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694449563; x=1695054363; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MM5PuddmF3Ns2TMQQzK07igiRdQ8RPlMsG5OfsCW7d8=; b=hZDXRcH6KdOYW7HYhe59QM437osz1B6pTtETOjNxHAh+GBCpLuQ1jI8CKrl3NAgN/R s5oBdDTFhk14rzLMHL3UpXuZeUKbLWZAqme5U5u1+RvP/EgIs16i/l8lnm0bW/fv8EP3 XjwZ7CuHX0ACFsIFIWwb00mZ0jsj2JXWUNfO1dD3SYqQpRkQ4ZDZcUwP6qx4EvLO/bHQ l9GfvHwq3WK3hqQ41yRhkyUJ7lW7bLhb5QdpwUW11W08t4EbxRilXRsgEWx7cNJxrudW OeSxfovSnkgziI7ZnOulmFR/BNzl9RNAcjLrzo1D1uSWafrsJacAT/R3+IrycNAgO12u VmOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694449563; x=1695054363; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MM5PuddmF3Ns2TMQQzK07igiRdQ8RPlMsG5OfsCW7d8=; b=e8DaU9K9ObLmYqdDUA4utQbUB/LslcWex5Mu4IrjmM/rV9NHx5dQ1r/Lc8v+RzUUt5 sXiLxLpoGVGebK4wJwAtuCUK/sZrSNo+ABbPjWAwl/oupqGjOWpm6X9xlb0tIlmh26NA ZstKW1sld8QfMcN7o5knf8LMju+FS0tVYJyDwgRB8lj6cxMHfjDTfqnSbV6tFn3JmUYY NKHsSmOh3vr+gz1Ugp7Dj9bi5a8EUmTubDVdPft0F/AJu3PEx8wYg2XZRIojCUtdwLyp 57D9hPBOFHUy4zcdML3n01eBsJyV0EYJ8fYTPAPJ46aquF6K1KtOLgVNbNagvzh3N3yX 30VQ== X-Gm-Message-State: AOJu0YxpQYX6jm6nNplI4c6b8Cy2tvJWXsYONop+lS/rO+ry2GQBhYC6 ZSTtZ9yjETJkXbaAA0iAr1+onsD45GuIJ48U8+FPVip6 X-Google-Smtp-Source: AGHT+IFYswDBFn/mdCNrbbuSWSzUwx+JQc/zZnYlQTMXdIJ0A7Baq/6RfkLGvmz46BzilO2YDs57npwiw1IatOA4FJw= X-Received: by 2002:a17:90a:e398:b0:273:ec82:5554 with SMTP id b24-20020a17090ae39800b00273ec825554mr119906pjz.9.1694449562588; Mon, 11 Sep 2023 09:26:02 -0700 (PDT) In-Reply-To: <838r9crel3.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=filippo.argiolas@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310474 Archived-At: On Mon, Sep 11, 2023 at 4:04=E2=80=AFPM Eli Zaretskii wrote: > > > From: Filippo Argiolas > > 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