From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#16200: shr should allow user to toggle HTML-specified colors on and off Date: Thu, 03 Apr 2014 08:37:09 +0000 Message-ID: <87ioqq7qru.fsf@violet.siamics.net> References: <87zjnvwte8.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1396523030 7838 80.91.229.3 (3 Apr 2014 11:03:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2014 11:03:50 +0000 (UTC) To: 16200@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 03 13:03:45 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WVeHq-00075K-UY for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Apr 2014 11:50:19 +0200 Original-Received: from localhost ([::1]:42735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVdAA-0005YC-4h for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Apr 2014 04:38:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVdA2-0005Xo-Oq for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 04:38:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVd9y-0006cl-5q for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 04:38:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVd9x-0006c8-CK for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 04:38:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WVd9w-0000mY-0H for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 04:38:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Apr 2014 08:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16200 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16200-submit@debbugs.gnu.org id=B16200.13965142452956 (code B ref 16200); Thu, 03 Apr 2014 08:38:02 +0000 Original-Received: (at 16200) by debbugs.gnu.org; 3 Apr 2014 08:37:25 +0000 Original-Received: from localhost ([127.0.0.1]:33746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVd9I-0000lb-TG for submit@debbugs.gnu.org; Thu, 03 Apr 2014 04:37:25 -0400 Original-Received: from fely.am-1.org ([78.47.74.50]:37171) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVd9E-0000lR-T0 for 16200@debbugs.gnu.org; Thu, 03 Apr 2014 04:37:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From; bh=RYaWahNobJit1kOmp0Kz5XKyxAfMLuSZ7whreG7tKL0=; b=CAefce+MQzbmpLEB0Frl+uYzyS6qRvEMEv6IAXOa1jhwr3YlgsmOY5VTgvB0yK29SwTkNjvMu/1q8tatLvg3Ey8OME57TFYEudrIKIrJMYTEFINH3T1fUC/b2Z2UnqB6L4NxxP2QXCWnApqyIo4cSRMHtNr78rK5vviIN2gkSZU=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1WVd9D-0001Le-09 for 16200@debbugs.gnu.org; Thu, 03 Apr 2014 08:37:19 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1WVd94-0006i5-E6 for 16200@debbugs.gnu.org; Thu, 03 Apr 2014 15:37:10 +0700 In-Reply-To: <87zjnvwte8.fsf@violet.siamics.net> (Ivan Shmakov's message of "Fri, 20 Dec 2013 13:20:47 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87650 Archived-At: >>>>> Ivan Shmakov writes: > Badly-formatted netnews articles aren=E2=80=99t unknown in Usenet, so Gn= us > already comes with a set of commands [1] to improve the formatting of > the messages as they=E2=80=99re shown to the user. > I=E2=80=99d argue, however, that ugly HTML documents are much more commo= n on > the Web than such articles are on Usenet. Granted, shr.el does not > (as of yet) support a good deal of features casually used to degrade > the reader=E2=80=99s experience. (Such as, for instance, font-size:, especially when combined with a non-=E2=80=98auto=E2=80=99 width:.) > Still, it supports the =E2=80=98fgcolor=E2=80=99, =E2=80=98text=E2=80=99= and =E2=80=98bgcolor=E2=80=99 attributes to > , and the =E2=80=98color=E2=80=99 attribute to , leaving the user no > easy way to get rid of whatever color scheme the Web page author has > decided to use. And, well, it also supports the color-related CSS properties, at least those specified via the =E2=80=98style=E2=80=99 HTML attribute. [=E2=80=A6] > As a crude (but working) workaround, those suffering of the =E2=80=9Ctoo= =C2=A0much > color=E2=80=9D problem may choose to redefine the shr-tag-body and > shr-tag-font element handlers to simplistic wrappers around > shr-generic in their ~/.emacs, like: [=E2=80=A6] I stand corrected: this workaround does not help with the CSS (=E2=80=98style=E2=80=99 attribute) color settings. Redefining shr-colorize-region to a no-op, however, seems to work: (eval-after-load 'shr '(defun shr-colorize-region (start end fg &optional bg) nil)) A proper solution would probably be to allow for a custom initial stylesheet, along with a proper cascading implementation (including the =E2=80=98!important=E2=80=99 flag handling), so that the us= er could both specify the default appearance, /and/ override the explicit styles as set by the HTML document being rendered. > [1] http://www.gnu.org/software/emacs/manual/html_node/gnus/Article-Wash= ing.html [=E2=80=A6] --=20 FSF associate member #7257