From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/74360 Path: news.gmane.org!not-for-mail From: Kan-Ru Chen Newsgroups: gmane.emacs.gnus.general Subject: shr-color: Error on terminal - "unspecified-bg" Date: Thu, 25 Nov 2010 12:25:47 +0800 Message-ID: <87eiaani5w.fsf@anar.kanru.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1290659217 27537 80.91.229.12 (25 Nov 2010 04:26:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Nov 2010 04:26:57 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M22725@lists.math.uh.edu Thu Nov 25 05:26:53 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 1PLTQ4-0004xv-9d for ding-account@gmane.org; Thu, 25 Nov 2010 05:26:52 +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 1PLTPL-0005yW-OY; Wed, 24 Nov 2010 22:26:07 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PLTPK-0005yK-3Y for ding@lists.math.uh.edu; Wed, 24 Nov 2010 22:26:06 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PLTPI-00036c-Eu for ding@lists.math.uh.edu; Wed, 24 Nov 2010 22:26:05 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PLTPH-0000gx-00 for ; Thu, 25 Nov 2010 05:26:03 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PLTPH-0004eK-NS for ding@gnus.org; Thu, 25 Nov 2010 05:26:03 +0100 Original-Received: from 61-30-10-70.static.tfn.net.tw ([61.30.10.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Nov 2010 05:26:03 +0100 Original-Received: from kanru by 61-30-10-70.static.tfn.net.tw with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Nov 2010 05:26:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 61-30-10-70.static.tfn.net.tw User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:NBJ6RT9NJoYjcI+Lj1ye++vLyRc= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:74360 Archived-At: Hi, I usually use the emacs tty interface, the recent shr-color change seems cannot handle. (frame-parameter nil 'foreground-color) => "unspecified-fg" (frame-parameter nil 'background-color) => "unspecified-bg" (x-color-values "unspecified-bg") => nil Debugger entered--Lisp error: (wrong-number-of-arguments #[(red green blue) "\303\304\305 #\"\207" [red green blue apply xyz->lab rgb->xyz] 6 ("/home/kanru/src/mirror/gnus/lisp/color-lab.elc" . 4929)] 0) rgb->lab() apply(rgb->lab nil) (let* ((fg-lab (apply (quote rgb->lab) (rgb->normalize fg))) (bg-lab (apply (quote rgb->lab) (rgb->normalize bg))) (fg-bg-distance (color-lab-ciede2000 fg-lab bg-lab)) (luminance-distance (abs (- (car fg-lab) (car bg-lab))))) (if (and (>= fg-bg-distance shr-color-visible-distance-min) (>= luminance-distance shr-color-visible-luminance-min)) (list bg fg) (let ((Ls (set-minimum-interval (car bg-lab) (car fg-lab) 0 100 shr-color-visible-luminance-min fixed-background))) (unless fixed-background (setcar bg-lab (car Ls))) (setcar fg-lab (cadr Ls)) (list (if fixed-background bg (apply (quote format) "#%02x%02x%02x" (mapcar (lambda ... ...) (apply ... bg-lab)))) (apply (quote format) "#%02x%02x%02x" (mapcar (lambda (x) (* ... 255)) (apply (quote lab->rgb) fg-lab))))))) shr-color-visible("unspecified-bg" "#800000" t) shr-color-check("#800000" nil) shr-insert-foreground-overlay("#800000" 735 800) shr-descend((span (:style . "color: #800000;") (text . "■ 這把折疊萬能小刀的製造日期可遠溯至一千八百年前,是羅馬人「吃飯的傢伙」。工藝程度跟影集《百戰天龍》裡馬蓋先拿的那把相去不遠。"))) ... Cheers, Kanru -- A badly written book is only a blunder. A bad translation of a good book is a crime. -- Gilbert Highet