From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [RFC PATCH] Per-window face support Date: Thu, 7 Jun 2018 20:18:18 -0700 Message-ID: <5aac4e92-1fd7-193b-803c-a573b9ce6d28@dancol.org> References: <5e08587a56ad528599ed5fb259be6335.squirrel@dancol.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1528427791 2883 195.159.176.226 (8 Jun 2018 03:16:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2018 03:16:31 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 08 05:16:26 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fR7t4-0000f2-0d for ged-emacs-devel@m.gmane.org; Fri, 08 Jun 2018 05:16:26 +0200 Original-Received: from localhost ([::1]:32834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR7vB-0006nL-3L for ged-emacs-devel@m.gmane.org; Thu, 07 Jun 2018 23:18:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR7v4-0006mv-HW for emacs-devel@gnu.org; Thu, 07 Jun 2018 23:18:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fR7v1-00046e-Bl for emacs-devel@gnu.org; Thu, 07 Jun 2018 23:18:30 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:36582) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fR7v1-000468-0q for emacs-devel@gnu.org; Thu, 07 Jun 2018 23:18:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=sj6lsCk138gwcBXVAdrFjk5SikHZDZ7y4w6Q98AqFA0=; b=aGpw6zfvu2e/Y2n5WTQQj2XZa0QlXYssnVqDJRZPgEEzhAU9Sq+jV/AtyjduXTJq+QfJ22kNGQ7VszjvQgeJonjU0sOPHJ8HOMfafXA5i+VrNoPiBl/jlXK5VlwYCBEmpXjdoss9Pat0PbsGBe5waDPcRQGChyxFA3uYPzmrRTmHBU3+zqgiv3ctArncoc4ZmDr68yRSDkvRCdHd19YqqZmTsCpYNzOpkz42kRg8mjDsXVG3mRDm3gLWXPLZ5y5Xnp32O0L44n/KOjOqmQOXjbbKXBUUbPTdchzyN2yY/klQRWtvlpL6lNob+dZCf2fwSgVbcnmvuG7wO0NE49QTdw==; Original-Received: from [172.92.145.124] (helo=[192.168.86.27]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fR7uy-0002tg-1y; Thu, 07 Jun 2018 20:18:24 -0700 In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226109 Archived-At: On 06/07/2018 07:57 PM, Stefan Monnier wrote: >> This patch lets us actually vary faces on a window-by-window basis. > > Sounds good. > >> + 4. Conses of the form >> + (:filter (:window PARAMETER VALUE) FACE-SPECIFICATION), >> + which applies FACE-SPECIFICATION only if the >> + given face attributes are being evaluated in the context of a >> + window with a parameter named PARAMETER being EQ VALUE. > > Is there any chance we could allow running Elisp code there, i.e. allow I thought about that, but I worry that allowing arbitrary code to execute there would make any kind of caching invalidation or something much harder later. ISTM that lisp should always be able to compute whatever it wants ahead of time and smuggle the result into redisplay via the window parameter. > (:filter FUNCTION FACE-SPECIFICATION) > > or even just > > (:filter FUNCTION) > > where FUNCTION returns the FACE-SPECIFICATION (or nil, say). If we went this route, I'd probably want to call it :eval. >> DEFSYM (QCignore_defface, ":ignore-defface"); >> >> + /* Used for limiting character attributes to windows with specific >> + characteristics. */ >> + DEFSYM (Qwindow_kw, ":window"); >> + DEFSYM (Qfiltered_kw, ":filtered"); > > Our convention is to use QC rather than Q_kw for ":foo", as > can be seen above for :ignore-defface. Gah, yes, of course.