From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: C equivalent for: (face-attribute 'region :background (selected-frame) 'default) Date: Wed, 27 Sep 2017 14:58:53 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1506491987 1221 195.159.176.226 (27 Sep 2017 05:59:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 27 Sep 2017 05:59:47 +0000 (UTC) User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) Cc: emacs-devel@gnu.org To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 27 07:59:41 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 1dx5Nk-0008Fk-Kz for ged-emacs-devel@m.gmane.org; Wed, 27 Sep 2017 07:59:40 +0200 Original-Received: from localhost ([::1]:52266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dx5Nq-0002d2-Gz for ged-emacs-devel@m.gmane.org; Wed, 27 Sep 2017 01:59:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dx5N8-0002Yt-PM for emacs-devel@gnu.org; Wed, 27 Sep 2017 01:59:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dx5N4-0000uZ-St for emacs-devel@gnu.org; Wed, 27 Sep 2017 01:59:02 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:63186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dx5N4-0000qb-DJ for emacs-devel@gnu.org; Wed, 27 Sep 2017 01:58:58 -0400 Original-Received: from fermat1.math.s.chiba-u.ac.jp (fermat [192.168.32.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id B4B95F08F3; Wed, 27 Sep 2017 14:58:53 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 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:218817 Archived-At: >>>>> On Tue, 26 Sep 2017 17:24:44 -0700, Keith David Bershatsky said: > To erase the floating glyphless fake cursors (with no text), I draw the shape of the cursor using the current background color. The current design is to get everything into the LSL color vector, and then treat it differently once I get over to nsterm.m, w32term.c, or xterm.c depending upon the Emacs build. In terms of the active region face, I needed to get the LSL equivalent for the region background. Today, I ported from Lisp to C the functions `face-attribute` and `face-attribute-merged-with` which gets me the color string: That doesn't sound like a good design. I think you should always use faces to specify/retrieve colors so we can consistently utilize existing infrastructure such as frame-wise themes. Erasing cursors would be possible by calling `draw_glyphs' just as `expose_area' does (it might be the case that you have to fill with the frame background color beforehand). Also, be sure to draw cursors/crosshairs on expose_frame while they are active. Otherwise they become invisible when we hide and then show a frame, for example. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp