From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: region-based face-remapping Date: Fri, 5 Jan 2024 18:25:24 +0200 Message-ID: <53ab9162-ab3f-482e-8058-4947e071c2ff@gutov.dev> References: <83y1d7zy8s.fsf@gnu.org> <3592E8C5-35FF-44FF-88ED-B458303BF15A@gmail.com> <83edeyzjgp.fsf@gnu.org> <83y1d6y1n4.fsf@gnu.org> <3ce1e4f9-7f94-4d55-a614-a4c2c3ad6c27@gutov.dev> <83bka1y3w3.fsf@gnu.org> <1cb0b482-1149-4695-9345-a495418da7f9@gutov.dev> <834jfsw4du.fsf@gnu.org> <83bk9zvogn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1733"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: jdtsmith@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 05 17:26:29 2024 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 1rLn1g-0000D7-4G for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jan 2024 17:26:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLn0n-00046G-MM; Fri, 05 Jan 2024 11:25:33 -0500 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 1rLn0m-00045T-3A for emacs-devel@gnu.org; Fri, 05 Jan 2024 11:25:32 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLn0j-00040G-KI; Fri, 05 Jan 2024 11:25:31 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 77A035C0258; Fri, 5 Jan 2024 11:25:28 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 05 Jan 2024 11:25:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1704471928; x=1704558328; bh=MyQoJgIkq8yp5vtTDEs7hadv6eYFphqfdTxrSC9wcmU=; b= oHEyEJgMqAZCpFTP+jZ9+U8eXbgAtlArWyep/loN9Y5Zm+L+7/im7ZeW48pNJOE9 wgQSCjinKjHTlGYwU/Mzz4rllA5m7HjSnUauLC2uW5968tP5W49W/sCLVSJgp+qW 1Az5YVpql9s4VTE7moImeXx2FWQIMl4KZX2s+d7SE7vlHj98Z1ifBmlqWsdUMnxr 0pgEGeb0nIy4ORZovPNkIhzugeE+o9sbM/ylB9KTqtcx7hrsgL6jOn8kzIz4boZ7 knunU789htGl52xlbOc+X+ESXe3WxPj1451TUhIi2c6Q4qDLtz8mQDn2rCm0sJhf 9o5aXnxK/ih8VVZuJQcePQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704471928; x= 1704558328; bh=MyQoJgIkq8yp5vtTDEs7hadv6eYFphqfdTxrSC9wcmU=; b=6 89GqpM6cgIqVkclQ1p0M5yA25gzedEBjoqA0p5CYK/rgpm5CGphuKazLn+uOczSk qX+tLt7NfCPAqQ4lYCLsDYAiffU8rAvs2ieXEPaADK0KAVIC9XxtqXr5X520Ded/ AEOl0krr3V+7SJxcMtL+3TQVSoGDNUPEcF0IiTG962NIkrGtRNUf5Ei0N+G1RvPO j9InlXEzqinq50ug5B65nd95u0FDwr24nctmwrU55NENV5YDQwdNJUT8QmPDS1nw edCEauzxpqQqiDmj5Tj2rvt9NEE66acfB3LdzOLUUmnRONtvlgsi3avQQTl54Ri4 u76+riWGfy0qiV8j4nnKg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegledgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Jan 2024 11:25:27 -0500 (EST) Content-Language: en-US In-Reply-To: <83bk9zvogn.fsf@gnu.org> Received-SPF: pass client-ip=66.111.4.29; envelope-from=dmitry@gutov.dev; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:314575 Archived-At: On 05/01/2024 16:34, Eli Zaretskii wrote: >> Date: Fri, 5 Jan 2024 16:18:28 +0200 >> From: Dmitry Gutov >> Cc: jdtsmith@gmail.com, emacs-devel@gnu.org >> >> On 05/01/2024 10:50, Eli Zaretskii wrote: >>>> Date: Fri, 5 Jan 2024 05:49:24 +0200 >>>> Cc:jdtsmith@gmail.com,emacs-devel@gnu.org >>>> From: Dmitry Gutov >>>> >>>> On 04/01/2024 09:05, Eli Zaretskii wrote: >>>>> . one of the subroutines of face_at_buffer_position calls some Lisp >>>>> hook >>>>> . that Lisp hook calls code that calls face-font (or some other >>>>> primitive which takes face-remapping-alist into account) >>>> Could you give an example of a Lisp hook which might be called from >>>> face_at_buffer_position's subroutines? >>> Why is having a specific example important? >>> >>> Are you saying that there can never be such an example? >> >> Yes, it would seem odd to me for face_at_buffer_position to call any hooks. > > More strange hooks have been added. For example, a face attribute > could have a function value, in which case face_at_buffer_position > will call into Lisp. If we added such a feature someday, indeed realize_named_face and others would need to be changed, e.g. by passing the amended value of face-remapping-alist lexically to get_lface_attributes and all its callers (not necessarily the buffer position, though). But until that happens, it might not be necessary. >> But if it did, I would consider whether any of the hooks being called >> would allow substituting the face with a different one (making it a >> different way to solve the present feature request). > > Any face merging looks at face-remapping-alist, so you cannot possibly > negate this. What I was saying is, if an attribute could be a Lisp function, it could be another way to implement what JD is asking for, one that doesn't introduce the 'face-remapping-alist' text/overlay property. But it would be a more complex, less declarative way of doing that. And again, I'm not sure how the overall performance would look with such an addition. Anyway, the feature seems doable to me, and probably compatible with any addition similar to your example, given enough maintenance effort. I'm not saying we should necessarily have it, though.