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: face-attribute and face-remapping-alist Date: Tue, 30 Mar 2021 22:13:22 +0300 Message-ID: <8335wcjvzh.fsf@gnu.org> References: <834kgsjwdf.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23359"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: gliao.tw@pm.me Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 30 21:14:02 2021 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 1lRJoO-0005xK-GR for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Mar 2021 21:14:00 +0200 Original-Received: from localhost ([::1]:41004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRJoM-000674-6C for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Mar 2021 15:13:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRJnd-0005g8-To for emacs-devel@gnu.org; Tue, 30 Mar 2021 15:13:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44674) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRJnd-0003Z0-J7; Tue, 30 Mar 2021 15:13:13 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2711 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lRJnb-0003CW-Lp; Tue, 30 Mar 2021 15:13:12 -0400 In-Reply-To: <834kgsjwdf.fsf@gnu.org> (message from Eli Zaretskii on Tue, 30 Mar 2021 22:05:00 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:267193 Archived-At: > Date: Tue, 30 Mar 2021 22:05:00 +0300 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > Thanks, but unconditionally changing the behavior of face-attribute in > such fundamental ways is a non-starter. There must be a way to still > get the frame-specific face attributes, un-effected by buffer-specific > remapping. face-attribute is quite a low-level API, and face > remapping is a higher-level feature. > > So if we want face-attribute to pay attention to face remapping, that > must be an optional behavior under control of some optional argument > or a variable that could be let-bound. > > Alternatively, we could introduce a new API for what you want. And btw, I don't really understand the difficulty: fetching the remapped face from face-remapping-alist is trivial. Thereafter, face-attribute will do what you want. So I don't even think I understand the problem you are trying to solve. I guess a detailed description of some specific example would help here. In any case, please don't forget that frame-local and buffer-local values cannot be intermixed without producing undesirable effects. Face remapping was introduced to allow finer resolution in face attributes than the per-frame one, under the control of the application. Your proposal pushes the buffer-local aspects to the lower levels, and out of the application's control, which I don't think is TRT.