From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Local face remapping Date: Wed, 4 Oct 2023 08:58:34 -0400 Message-ID: <1AB6E9C8-1BCB-4C0A-A4AF-45F5C64D9B4C@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_2B33907A-C5E9-4BFD-BE44-ADB41036D415" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37283"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 04 15:00:27 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 1qo1UI-0009UF-JU for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Oct 2023 15:00:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo1T2-0002Id-2H; Wed, 04 Oct 2023 08:59:08 -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 1qo1Sy-0002I1-Fq for emacs-devel@gnu.org; Wed, 04 Oct 2023 08:59:04 -0400 Original-Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo1Sp-0003hc-5w for emacs-devel@gnu.org; Wed, 04 Oct 2023 08:59:04 -0400 Original-Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-7740729ae12so142763885a.1 for ; Wed, 04 Oct 2023 05:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696424328; x=1697029128; darn=gnu.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=4yhpabwwMjjMvrhJzVEf0z5mwPMupj5LolKoUAxUKUw=; b=Zm4cg7ymyuFXTKJvIp0URRz6aDnTc3vKNFYoxWE/qLirABEI5IydMiOArJiNxy84He RvVOOfGmyOwQ1yLcLH/oxukEJkQjVsHH2KVszXPQRCLqjhSCOWXXO27qZ8hgO2xkG9S0 jhPVoaetZF1WWm9V9kyrTf/wr5PsFsJYIM4xeNediUcmYMj5WAAHkvSDaoa8qu5sGjHn 8DnhCEZRgbW8q/wZzsUxpS+PaI5X8ry3KF15pFrsUKWFC8pYl02NqE1Vov9fnRUOWnq+ qqAFbfn+a28LDrs5+Wo7jzIO1p34Kj+ln9agstNL8j15/DIctGit53A9ITUcN3j1mjiF BZcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696424328; x=1697029128; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4yhpabwwMjjMvrhJzVEf0z5mwPMupj5LolKoUAxUKUw=; b=khi26S04OQOzRM5TXG+22jOHzy7n+RmS77oJRAgCj+tEbrImCyw6yNVFGG8nbn7ac2 z+LjG1hDPGFAv4ffQLj0LxbY679y++uTvkqfFrV/nqvYlMKeBqjWeqObGxAHhSWR0qDz Qxqhh29PYdL74krjmQ/fpunDkbrS85BWpztes67CEaiLTf7dR6Bln7LF3jXgAt4i4GFq v9vboXkYPBjpBlFBdiaj+NHCUsahQy0rhGShR51jNTos7W4jTGVgadkFDESTHBOp2jWz vQM91Ls14MjS2wKZxoc6JcHQmzu+oURFbD2G20oBeMFGxt7xiB4CJHf0HUnqJH8yV+Pk UoIQ== X-Gm-Message-State: AOJu0Ywx8+9RgQKSibwZ+LZTi7lG6cG9NmXRQfTq6Q1ehvRclRErS1A8 tImB8CTGSGFBbxCrfHxZE1Ls8aVmI//8Kw== X-Google-Smtp-Source: AGHT+IHnbiN3oS+nbWMdFt2zZz6IkSTlLnCUmw8rB0AZaoy99TZ9hAUiPSNmEThLo9rzFGnApKJ8vA== X-Received: by 2002:a05:620a:d93:b0:774:2893:3f25 with SMTP id q19-20020a05620a0d9300b0077428933f25mr2533667qkl.25.1696424327758; Wed, 04 Oct 2023 05:58:47 -0700 (PDT) Original-Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id f4-20020a05620a15a400b007756c0853a5sm1226148qkk.58.2023.10.04.05.58.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2023 05:58:46 -0700 (PDT) X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=jdtsmith@gmail.com; helo=mail-qk1-x72a.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=no 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:311270 Archived-At: --Apple-Mail=_2B33907A-C5E9-4BFD-BE44-ADB41036D415 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 My indent-bars package makes = good use of `face-remap-add-relative=E2=80=99 to provide performant = depth-based context highlighting via a post-command-hook. This is very = fast and simple: just check the indentation depth, and if it changed, = update the buffer-local face remapping list accordingly. I am now = considering a feature which would make this highlighting local in = regions based on treesitter block scope. Is there any means of achieving local face remapping within regions? = Ideally overlays could be used, if they had a `remapping-alist' = property, similar to the global or buffer-local value, but applying only = within the bounds of the overlay. Given that this does not exist, is = there another way to achieve something similar? --Apple-Mail=_2B33907A-C5E9-4BFD-BE44-ADB41036D415 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 My indent-bars pack= age makes good use of `face-remap-add-relative=E2=80=99 to provide = performant depth-based context highlighting via a post-command-hook. =  This is very fast and simple: just check the indentation depth, = and if it changed, update the buffer-local face remapping list = accordingly.  I am now considering a feature which would make this = highlighting local in regions based on treesitter block = scope.

Is there any means of achieving local = face remapping within regions?  Ideally overlays could be used, if = they had a `remapping-alist' property, similar to the global or = buffer-local value, but applying only within the bounds of the overlay. =  Given that this does not exist, is there another way to achieve = something similar?

= --Apple-Mail=_2B33907A-C5E9-4BFD-BE44-ADB41036D415--