From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/74296 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.gnus.general Subject: Re: Colour manipulation Date: Wed, 24 Nov 2010 09:52:23 +0100 Message-ID: <87r5ebf6ig.fsf@keller.adm.naquadah.org> References: <87pquvldcs.fsf@lifelogs.com> <87oc9yp21w.fsf@lifelogs.com> <87lj4pmgu7.fsf@keller.adm.naquadah.org> <87oc9ihjbk.fsf@keller.adm.naquadah.org> <8739quh5gk.fsf@keller.adm.naquadah.org> <87wro6fpgo.fsf@keller.adm.naquadah.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1290588812 2685 80.91.229.12 (24 Nov 2010 08:53:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 24 Nov 2010 08:53:32 +0000 (UTC) Cc: ding@gnus.org To: Katsumi Yamaoka Original-X-From: ding-owner+M22661@lists.math.uh.edu Wed Nov 24 09:53:28 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PLB6W-0001bm-4k for ding-account@gmane.org; Wed, 24 Nov 2010 09:53:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PLB67-0006Rl-O5; Wed, 24 Nov 2010 02:53:03 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PLB66-0006RX-Eo for ding@lists.math.uh.edu; Wed, 24 Nov 2010 02:53:02 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PLB61-000357-EI for ding@lists.math.uh.edu; Wed, 24 Nov 2010 02:53:02 -0600 Original-Received: from prometheus.naquadah.org ([212.85.154.174] helo=mx1.naquadah.org) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PLB60-0001pX-00 for ; Wed, 24 Nov 2010 09:52:56 +0100 Original-Received: by mx1.naquadah.org (Postfix, from userid 8) id 6F6235C1AC; Wed, 24 Nov 2010 09:52:26 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on prometheus.naquadah.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 Original-Received: from keller.adm.naquadah.org (unknown [IPv6:2a01:e35:2e39:e900:222:faff:fe9d:ce44]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.naquadah.org (Postfix) with ESMTPSA id 78E825C14C; Wed, 24 Nov 2010 09:52:24 +0100 (CET) Original-Received: from jd by keller.adm.naquadah.org with local (Exim 4.72) (envelope-from ) id 1PLB5T-0002Ff-OC; Wed, 24 Nov 2010 09:52:23 +0100 Mail-Followup-To: Katsumi Yamaoka , ding@gnus.org In-Reply-To: (Katsumi Yamaoka's message of "Wed, 24 Nov 2010 14:45:04 +0900") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:74296 Archived-At: On Wed, Nov 24 2010, Katsumi Yamaoka wrote: > The causes are SPCs in rgb numbers. So, a workaround is: > > --- shr.el~ 2010-11-24 00:31:48 +0000 > +++ shr.el 2010-11-24 05:43:38 +0000 > @@ -502,7 +502,8 @@ >=20=20 > (defun shr-insert-color-overlay (color start end) > (when color > - (when (string-match " " color) > + (when (and (not (string-match "\\`rgb([^\)]+)\\'" color)) > + (string-match " " color)) > (setq color (car (split-string color)))) > (let ((overlay (make-overlay start end))) > (overlay-put overlay 'face (cons 'foreground-color I've change that, since it forgot to exclude hsl() colors too. Until we have a proper CSS parser, it just returns the hexadecimal part of a string like "#aabbcc !important". That should do the trick. :) --=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info