From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Fill column indicator functionality Date: Sat, 04 May 2019 14:04:22 +0300 Message-ID: <83r29elbux.fsf@gnu.org> References: <20190407200514.2p6gfucdcdsrqe47@Ergus> <83ef6d8c40.fsf@gnu.org> <20190408085102.ozcuvs323ilfid7n@Ergus> <83bm1g8s02.fsf@gnu.org> <20190412134633.g47vybtpkwxyw7dq@Ergus> <834l73mir0.fsf@gnu.org> <20190501110808.27o64tawy2gyjocr@Ergus> <83sgtvn08w.fsf@gnu.org> <20190503174935.5i2gn2nsxr4aezvf@Ergus> <83ftpvmlg2.fsf@gnu.org> <20190503210508.6jeebxmuocjmgva4@Ergus> <83a7g2n20d.fsf@gnu.org> <6439F397-1E34-4E09-8DD3-C50433D98131@aol.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="265892"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 04 13:04:51 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMsTK-0016x4-Af for ged-emacs-devel@m.gmane.org; Sat, 04 May 2019 13:04:50 +0200 Original-Received: from localhost ([127.0.0.1]:54655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMsTJ-0006oz-CC for ged-emacs-devel@m.gmane.org; Sat, 04 May 2019 07:04:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMsTA-0006js-RY for emacs-devel@gnu.org; Sat, 04 May 2019 07:04:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMsTA-0000SY-Me; Sat, 04 May 2019 07:04:40 -0400 Original-Received: from [176.228.60.248] (port=4880 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hMsT9-0008Up-02; Sat, 04 May 2019 07:04:40 -0400 In-reply-to: <6439F397-1E34-4E09-8DD3-C50433D98131@aol.com> (message from Ergus on Sat, 04 May 2019 11:37:13 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:236145 Archived-At: > Date: Sat, 04 May 2019 11:37:13 +0200 > From: Ergus > > It looks like we need only to keep the background colour also for the indicator. Are you sure that's all? And that some users won't want the indicator face's background to prevail? > I don't know if there is an easy way to do so and if it worth the effort. Given a face_id, you can get the face struct with FACE_FROM_ID. The face struct has a member named 'lface', which is a vector of the face's Lisp attributes. Each attribute in the vector has a known index. So doing something like this (untested) should change the background color of the indicator as requested: int region_face_id = lookup_named_face (NULL, it->f, Qregion, false); struct face *region_face = FACE_FROM_ID (it->f, region_face_id); Lisp_Object bg_color = region_face->lface[LFACE_BACKGROUND_INDEX]; face->lface[LFACE_BACKGROUND_INDEX] = STRINGP (bg_color) : bg_color : Qunspecified); assuming that 'face' used in the ASET line is the face of the indicator, as you compute it in your branch.