unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Richard Stallman <rms@gnu.org>
Cc: 19791@debbugs.gnu.org, larsi@gnus.org
Subject: bug#19791: 25.0.50; Bad HTML rendering
Date: Sun, 08 Feb 2015 19:52:34 +0200	[thread overview]
Message-ID: <831tm0b89p.fsf@gnu.org> (raw)
In-Reply-To: <83r3u2aq9b.fsf@gnu.org>

> Date: Sat, 07 Feb 2015 13:57:04 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 19791@debbugs.gnu.org, rms@gnu.org
> 
> > From: Lars Ingebrigtsen <larsi@gnus.org>
> > Cc: 19791@debbugs.gnu.org, rms@gnu.org
> > Date: Sat, 07 Feb 2015 12:30:42 +1100
> > 
> > Eli Zaretskii <eliz@gnu.org> 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





  reply	other threads:[~2015-02-08 17:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 12:41 bug#19791: 25.0.50; Bad HTML rendering Richard Stallman
2015-02-06 13:19 ` Lars Ingebrigtsen
2015-02-06 14:49   ` Eli Zaretskii
2015-02-06 17:14     ` Lars Ingebrigtsen
2015-02-06 18:59       ` Eli Zaretskii
2015-02-07  1:30         ` Lars Ingebrigtsen
2015-02-07 11:57           ` Eli Zaretskii
2015-02-08 17:52             ` Eli Zaretskii [this message]
2015-12-25 22:30               ` Lars Ingebrigtsen
2015-12-26  6:14                 ` Richard Stallman
2015-02-07 12:43   ` Richard Stallman
2015-02-07 13:09     ` Eli Zaretskii
2015-02-06 15:31 ` Stefan Monnier
2015-02-06 15:44   ` Eli Zaretskii
2015-02-06 18:09     ` Stefan Monnier
2015-02-07  1:32       ` Lars Ingebrigtsen
2015-02-07  7:14   ` Ivan Shmakov
2015-02-07  7:25     ` Matthew Carter
2015-02-07 11:50       ` Ivan Shmakov
2015-02-07 12:44   ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831tm0b89p.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=19791@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=rms@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).