From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19791: 25.0.50; Bad HTML rendering Date: Sun, 08 Feb 2015 19:52:34 +0200 Message-ID: <831tm0b89p.fsf@gnu.org> References: <87386ji3e1.fsf@building.gnus.org> <83wq3vccxc.fsf@gnu.org> <87zj8rezdc.fsf@building.gnus.org> <83mw4qdfxj.fsf@gnu.org> <87pp9mece5.fsf@building.gnus.org> <83r3u2aq9b.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1423418062 14422 80.91.229.3 (8 Feb 2015 17:54:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Feb 2015 17:54:22 +0000 (UTC) Cc: 19791@debbugs.gnu.org, larsi@gnus.org To: Richard Stallman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 08 18:54:18 2015 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 1YKW3j-000330-QJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Feb 2015 18:54:16 +0100 Original-Received: from localhost ([::1]:57301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKW3j-0006iJ-08 for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Feb 2015 12:54:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKW3b-0006bD-Rs for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 12:54:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKW3W-0005dm-Qh for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 12:54:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKW3W-0005dh-N3 for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 12:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YKW3W-0004I7-8T for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 12:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Feb 2015 17:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19791 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19791-submit@debbugs.gnu.org id=B19791.142341798716419 (code B ref 19791); Sun, 08 Feb 2015 17:54:02 +0000 Original-Received: (at 19791) by debbugs.gnu.org; 8 Feb 2015 17:53:07 +0000 Original-Received: from localhost ([127.0.0.1]:37512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKW2Z-0004Gf-3v for submit@debbugs.gnu.org; Sun, 08 Feb 2015 12:53:06 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:46681) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKW2T-0004G5-Q9 for 19791@debbugs.gnu.org; Sun, 08 Feb 2015 12:53:01 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NJG00B00S11IM00@a-mtaout20.012.net.il> for 19791@debbugs.gnu.org; Sun, 08 Feb 2015 19:52:50 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NJG00BX6SC21W90@a-mtaout20.012.net.il>; Sun, 08 Feb 2015 19:52:50 +0200 (IST) In-reply-to: <83r3u2aq9b.fsf@gnu.org> X-012-Sender: halo1@inter.net.il 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:99166 Archived-At: > Date: Sat, 07 Feb 2015 13:57:04 +0200 > From: Eli Zaretskii > Cc: 19791@debbugs.gnu.org, rms@gnu.org > > > From: Lars Ingebrigtsen > > Cc: 19791@debbugs.gnu.org, rms@gnu.org > > Date: Sat, 07 Feb 2015 12:30:42 +1100 > > > > Eli Zaretskii writes: > > > > > Where's that in the sources? > > > > `shr-color-check' and `shr-color-visible'. > > I think I see the problem: it is somehow related to bug #19802. In > particular, even if I do this: > > M-: (set-frame-parameter (selected-frame) 'background-color "black") RET > > I still get nil from (frame-parameter nil 'background-color). And > shr-color-check relies on the latter to report the background color of > the frame. > > So I guess solving that bug will also solve this, or at least move > closer to its solution. This turned out to be broken in more than one way, some of them only on master. The patch to fix them, relative to the current master, is below. I installed the changes on the branch and will install the master part shortly. Richard, could you please see if this solves the problem with "invisible" colors in HTML mails for you? It did for me. diff --git a/lisp/frame.el b/lisp/frame.el index ecb433e..8dce86b 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -259,6 +259,10 @@ (defun frame-notice-user-settings () (let ((newparms (frame-parameters)) (frame (selected-frame))) (tty-handle-reverse-video frame newparms) + ;; tty-handle-reverse-video might change the frame's + ;; color parameters, and we need to use the updated + ;; value below. + (setq newparms (frame-parameters)) ;; If we changed the background color, we need to update ;; the background-mode parameter, and maybe some faces, ;; too. @@ -266,7 +270,7 @@ (defun frame-notice-user-settings () (unless (or (assq 'background-mode initial-frame-alist) (assq 'background-mode default-frame-alist)) (frame-set-background-mode frame)) - (face-set-after-frame-default frame)))))) + (face-set-after-frame-default frame newparms)))))) ;; If the initial frame is still around, apply initial-frame-alist ;; and default-frame-alist to it. @@ -1200,7 +1204,9 @@ (defun set-background-color (color-name) (modify-frame-parameters (selected-frame) (list (cons 'background-color color-name))) (or window-system - (face-set-after-frame-default (selected-frame)))) + (face-set-after-frame-default (selected-frame) + (list + (cons 'background-color color-name))))) (defun set-foreground-color (color-name) "Set the foreground color of the selected frame to COLOR-NAME. @@ -1210,7 +1216,9 @@ (defun set-foreground-color (color-name) (modify-frame-parameters (selected-frame) (list (cons 'foreground-color color-name))) (or window-system - (face-set-after-frame-default (selected-frame)))) + (face-set-after-frame-default (selected-frame) + (list + (cons 'foreground-color color-name))))) (defun set-cursor-color (color-name) "Set the text cursor color of the selected frame to COLOR-NAME. diff --git a/src/frame.c b/src/frame.c index 96fe377..9060f56 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2615,7 +2615,12 @@ It is a list of elements of the form (PARM . VALUE), where PARM is a symbol. important when param_alist's notion of colors is "unspecified". We need to do the same here. */ if (STRINGP (value) && !FRAME_WINDOW_P (f)) - value = frame_unspecified_color (f, value); + { + Lisp_Object tem = frame_unspecified_color (f, value); + + if (!NILP (tem)) + value = tem; + } } else value = Fcdr (Fassq (parameter, Fframe_parameters (frame))); diff --git a/src/xfaces.c b/src/xfaces.c index 6e01ab0..6866aa8 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5703,7 +5703,7 @@ ALIST is an alist of (REGISTRY ALTERNATIVE1 ALTERNATIVE2 ...) entries. if (STRINGP (color) && SCHARS (color) && CONSP (Vtty_defined_color_alist) - && (def = assq_no_quit (color, call1 (Qtty_color_alist, frame)), + && (def = assoc_no_quit (color, call1 (Qtty_color_alist, frame)), CONSP (def))) { /* Associations in tty-defined-color-alist are of the form