From: Michael Heerdegen <michael_heerdegen@web.de>
To: 15900@debbugs.gnu.org
Subject: bug#15900: 24.3.50; foreground-color-at-point returns wrong results
Date: Fri, 15 Nov 2013 03:47:41 +0100 [thread overview]
Message-ID: <87mwl6xtwy.fsf@web.de> (raw)
In-Reply-To: <87siuyxvw7.fsf@web.de> (Michael Heerdegen's message of "Fri, 15 Nov 2013 03:04:56 +0100")
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Hello,
>
> `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.
Even
(face-at-point nil 'multiple)
is not correct. Evaluated in w3m with point on a link, i get
==> (w3m-current-anchor)
This is what I get for M-1 C-x = (excerpt)
,----------------------------------------------------------------------
| There is an overlay here:
| From 7785 to 7798
| evaporate t
| face w3m-current-anchor
| w3m-momentary-overlay t
|
|
| There are text properties here:
| balloon-help nil
| face (w3m-anchor)
| help-echo [Show]
| keymap [Show]
| mouse-face highlight
| rear-nonsticky t
| w3m-anchor-sequence 75
| w3m-anchor-title nil
| w3m-balloon-help [Show]
| w3m-href-anchor [Show]
| w3m-name-anchor [Show]
| w3m-name-anchor2 ("showmodes" "gb_70")
| w3m-safe-url-regexp nil
`----------------------------------------------------------------------
`face-at-point' disregards the face text property, it only returns the
face overlay property.
> So, what I need is a reliable `foreground-color-at-point'. Tips and
> alternatives welcome.
I try to use something like this as a workaround now:
--8<---------------cut here---------------start------------->8---
(cl-some
(lambda (face) (not (memq (face-foreground face nil t)
`(nil ,(face-attribute 'default :foreground)))))
(cl-mapcan (lambda (face-or-list) (if (facep face-or-list)
(list face-or-list)
face-or-list))
(list
(get-text-property (point) 'face)
(get-text-property (point) 'font-lock-face))))
--8<---------------cut here---------------end--------------->8---
Regards,
Michael.
next prev parent reply other threads:[~2013-11-15 2:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 2:04 bug#15900: 24.3.50; foreground-color-at-point returns wrong results Michael Heerdegen
2013-11-15 2:47 ` Michael Heerdegen [this message]
2013-11-15 8:26 ` Eli Zaretskii
2013-11-15 22:18 ` Michael Heerdegen
2013-11-16 0:26 ` Drew Adams
2013-11-16 8:57 ` Eli Zaretskii
2013-11-16 8:44 ` Eli Zaretskii
2013-11-17 2:33 ` Michael Heerdegen
2013-11-17 3:52 ` Eli Zaretskii
2013-11-17 5:35 ` Michael Heerdegen
2013-11-17 17:21 ` Eli Zaretskii
2022-04-22 13:30 ` Lars Ingebrigtsen
[not found] <<87siuyxvw7.fsf@web.de>
[not found] ` <<83li0qhxyl.fsf@gnu.org>
[not found] ` <<878uwpgvh8.fsf@web.de>
[not found] ` <<b0006d1c-b470-4297-a6d7-97d7ed118c28@default>
[not found] ` <<83vbzshggy.fsf@gnu.org>
2013-11-16 16:20 ` Drew Adams
2013-11-16 16:40 ` Eli Zaretskii
[not found] ` <<83y54ohh1n.fsf@gnu.org>
[not found] ` <<87siuv21v8.fsf@web.de>
[not found] ` <<83eh6fhegu.fsf@gnu.org>
[not found] ` <<87eh6flhfc.fsf@web.de>
[not found] ` <<83d2lzgd04.fsf@gnu.org>
2013-11-17 17:29 ` Drew Adams
2013-11-17 17:47 ` Eli Zaretskii
2013-11-17 22:38 ` Michael Heerdegen
2013-11-18 3:42 ` Eli Zaretskii
2013-11-18 7:50 ` Michael Heerdegen
[not found] <<6bc49739-fae0-4688-a3cc-8bbbc2fe1c04@default>
[not found] ` <<83li0ogv14.fsf@gnu.org>
2013-11-16 17:47 ` Drew Adams
2013-11-16 18:18 ` Eli Zaretskii
[not found] <<c18e0f8c-e172-497d-b572-69162d77132b@default>
[not found] ` <<83iovsgqhn.fsf@gnu.org>
2013-11-16 22:53 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mwl6xtwy.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=15900@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.