From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Local face remapping Date: Wed, 04 Oct 2023 19:54:25 +0300 Message-ID: <838r8i5nwe.fsf@gnu.org> References: <1AB6E9C8-1BCB-4C0A-A4AF-45F5C64D9B4C@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27057"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: JD Smith Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 04 18:55:08 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 1qo59P-0006hv-76 for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Oct 2023 18:55:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo58l-0005lA-4O; Wed, 04 Oct 2023 12:54:27 -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 1qo58d-0005TI-Jn for emacs-devel@gnu.org; Wed, 04 Oct 2023 12:54:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qo58d-0000Kl-BJ; Wed, 04 Oct 2023 12:54:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ijZUUGCmgpE8+KxxFCQBuCukv/eexnC71J1MLtc5UVs=; b=AEOibAat2XN2pTjQEl+I yaA/krMra4D9y/xCb71YlSj1TQxIqtVZseK/zBv9PpEZsPkcbTnNqbY1i4nQaCg+Tyiq7/9kK3Ven VQok50GOcVMAG+fPIn7qWL7R1hualbmfwY4BW+VLh0aT0P77+L1zhKks25yVA1WUW+2bWvsFDrS14 6ZsSVRuSwbmnJqt8zMvuvw8CYYLCHVbA8Bo6YA1+vvulLD+6lr0JQFczLmrp+PPGllovw6t/Q0cgx MOx+SRfxMGKVLfu4HEN5u5wBYFexcwVmwGr1lb47gmx1n7g1bfV48AS0Ux9OATE3aUDskAZcu1MuO X4rBb6lpNg0zZA==; In-Reply-To: <1AB6E9C8-1BCB-4C0A-A4AF-45F5C64D9B4C@gmail.com> (message from JD Smith on Wed, 4 Oct 2023 08:58:34 -0400) 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:311281 Archived-At: > From: JD Smith > Date: Wed, 4 Oct 2023 08:58:34 -0400 > > My indent-bars package makes good use of `face-remap-add-relative’ 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? Use different faces?