From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: Adding new variable for face-list in internal-make-lisp-face. Date: Sat, 04 Nov 2017 10:46:17 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1509817590 1246 195.159.176.226 (4 Nov 2017 17:46:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Nov 2017 17:46:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 04 18:46:26 2017 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 1eB2WX-0008Pq-5z for ged-emacs-devel@m.gmane.org; Sat, 04 Nov 2017 18:46:25 +0100 Original-Received: from localhost ([::1]:41776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eB2We-0004SR-Ks for ged-emacs-devel@m.gmane.org; Sat, 04 Nov 2017 13:46:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eB2WW-0004SK-7B for emacs-devel@gnu.org; Sat, 04 Nov 2017 13:46:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eB2WT-0006B1-4E for emacs-devel@gnu.org; Sat, 04 Nov 2017 13:46:24 -0400 Original-Received: from gateway34.websitewelcome.com ([192.185.148.142]:41855) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eB2WS-0006Al-VR for emacs-devel@gnu.org; Sat, 04 Nov 2017 13:46:21 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway34.websitewelcome.com (Postfix) with ESMTP id A855D3DF7 for ; Sat, 4 Nov 2017 12:46:18 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id B2WQepcgbDL8rB2WQeeaC7; Sat, 04 Nov 2017 12:46:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5Rne1KHYap0AnYlqCk7KfgY4Y2YceGJpOyKsgsKPtZQ=; b=MkAGn6SSa/yWDk6/BBxi5uBaKP HP+2llfo7sOmk0YliWQeuo6k3WW3/oBUlyaxC3++LHY9cZrRNBwkoI51pCWYZaWSq70BPeueZcV8e xoUGzRkh1K19aWpsm7+weRwhaL+YH7uih5qjKMEYjAeNQwUJ0EAY6AfUAEiZzrlj9FqYKxgrm2+yS B6R1jOfVRHhFt2N7pWY/v8A5VnDhi7FA+HNS6c8hbTE8lzmDxrlqfK+OhsrAUHE7pUUT67f3cSrvn /LZMhVFXUyqLt/vH/SSZzT6493q/czh2kAP2ZUoyX1xmf14/bd+INIgyvgwbXLpl5csaI1Q4LCssc WieJMC2A==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50265 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1eB2WP-002NvC-Qz; Sat, 04 Nov 2017 12:46:17 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1eB2WP-002NvC-Qz X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:50265 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.148.142 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:219925 Archived-At: What a wonderful treat it was to check my emails this morning and find the ingredients to properly calculating faces and its components! :) I ran into one little `emacs_abort` snag this morning while trying the following two test snippets, which came about when I changed the face background with `face-remap-add-relative` on a face that had been previously defined with `defface`. Should I run a pre-test for all 15 cases in lookup_basic_face to see if it would throw an `emacs_abort`, and then *only* call lookup_basic_face if success is guaranteed? Alternatively, perhaps using it.face_id obviates the need to use lookup_basic_face? TEST SNIPPETS: struct face *tab_face = FACE_FROM_ID (f, lookup_basic_face (f, it.face_id)); Lisp_Object tab_bg = tab_face->lface[LFACE_BACKGROUND_INDEX]; AUTO_STRING (my_string_one, "IT background: %s"); CALLN (Fmessage, my_string_one, tab_bg); #ifdef GLYPH_DEBUG debug_method_add (w, "face_id: %d", it.face_id); #endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [11-04-2017 01:13:33] <04 Nov 2017 10:13:33 +0200> FROM: Eli Zaretskii > > * * * > > Face IDs are ephemeral, because Emacs frees all faces and realizes > them anew from time to time, when it thinks the previous definitions > might be invalid. E.g., when the attributes of the default face > change, all the faces need to be recomputed, because many of them > inherit from the default face. > > So if you use the face ID, you need to recompute it each time you need > it. You cannot compute it once and then reuse the same value, because > sooner or later it will become invalid. > > * * * > > See next_element_from_display_vector for how the faces of glyphs from > a display table are used to display those glyphs. And because of what > I said above, once you have the face ID, you need to use lookup_*_face > functions to get the face corresponding to that ID. > * * * > > I believe I already explained how to get the fore- and back-ground > colors of a face given its ID in my message Re: Can we use FRAME_RIF > to return a Lisp_Object result? I think you should use the same > technique here.