Subject: Re: bug#15900: 24.3.50; foreground-color-at-point returns wrong results

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 22 Apr 2022 15:30:39 +0200

Michael Heerdegen <[email-masked]> writes:

> `foreground-color-at-point' doesn't return the expected result when
> there are several faces at point present.
>
> For example, on the red subject in a Gnus article buffer, or on a blue
> link in w3m, it returns "black".  Looking at the code, I see that
> `foreground-color-at-point' uses
>
>   (face-at-point)
>
> i.e., it looks only at one face and disregards the others.  This is
> especially meaningless when this first face doesn't specify any
> foreground at all.

It looks like this was fixed a couple years later in this commit:

commit 7ccedcb486ee4e37da54dd82a8557c80616d9467
Author:     Artur Malabarba <[email-masked]>
AuthorDate: Fri Oct 30 15:00:37 2015 +0000

    * lisp/faces.el: Refactor common code and fix a bug
    
    (faces--attribute-at-point): New function.  Fix a bug when the
    face at point is a list of faces and the desired attribute is not
    on the first one.
    (foreground-color-at-point, background-color-at-point): Use it.

And I've verified that (foreground-color-at-point) seems to return
sensible results in the test cases in Emacs 29, so I'm closing this bug
report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no