emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fill column indicator functionality


From: Eli Zaretskii
Subject: Re: Fill column indicator functionality
Date: Sat, 04 May 2019 14:04:22 +0300

> Date: Sat, 04 May 2019 11:37:13 +0200
> From: Ergus <address@hidden>
> 
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]